No description
Find a file
2025-08-10 14:01:17 +00:00
foundational_artifacts removed unnessecary file 2025-08-10 14:01:17 +00:00
node wrote in node 2023-04-06 09:40:24 -04:00
src fixed typing exports 2023-01-24 23:08:25 -05:00
tests ready to update deps 2023-12-17 16:34:31 +00:00
typescript wrote in node 2023-04-06 09:40:24 -04:00
.gitignore wrote in node 2023-04-06 09:40:24 -04:00
.gitpod.Dockerfile added foundational items 2023-12-17 16:26:35 +00:00
.gitpod.yml added docker files 2023-01-22 10:41:24 -05:00
enkodo.nimble added foundational items 2023-12-17 16:26:35 +00:00
README.md Update README.md 2023-01-26 14:42:51 -05:00

Gitpod Ready-to-Code

enkōdo

Enkodo is a cross platform encyption and serialization wrapper for monocypher written in nim, with compatibility targets in typescript and more planned in the future.

Building all targets

These are the nim instructions and what they do:

nimble buildall #creates all the libraries and helpers for all languages 

Usage

Nim

Below is a simple nim example of encypting, serializing and base64ing

import enkodo

let (a_secretKey, a_publicKey) = generateKeyPair()
let (b_secretKey, b_publicKey) = generateKeyPair()

let plaintext = cast[seq[byte]]("hello this is a test string")

let encObj = enc(a_secretKey,b_publicKey,plaintext)
let wrapped = wrap(encObj) //serialize and b64
let unwrapped = unwrap(wrapped) //unb64 and deserialize
let ptext = dec(b_secretKey,unwrapped)
doAssert(plaintext == ptext)

Typescript

Below is a simple typescript example of encypting, serializing and base64ing

import {
  enc,
  dec,
  generateKeyPair,
  unwrap,
  wrap
} from "https://deno.land/x/enkodo@v0.1.5/typescript/mod.ts";

const hello_world = new TextEncoder().encode("Hello World");
const [priv, pub] = generateKeyPair();
const [priv2, pub2] = generateKeyPair();

const enc_test = enc(priv, pub2, hello_world); //encrpyt
const wrapped = wrap(enc_test); //serialize and base64
const unwrapped = unwrap(wrapped); //de-serialize and unbase64
const plain = dec(priv2, unwrapped);

Nimble Test

Tests the encryption and serialization functions

nimble test 

Deno Test

Tests the encryption functions

deno test 
deno bench #runs the benchmark

Planned compatibility