encryptodon

Crates.ioencryptodon
lib.rsencryptodon
version0.1.8
sourcesrc
created_at2024-01-22 20:38:16.928383
updated_at2024-01-23 17:06:29.181262
descriptionPachyderm Goes Private 🐘🕶️
homepagehttps://github.com/seanwatters/encryptodon
repositoryhttps://github.com/seanwatters/encryptodon
max_upload_size
id1109177
size45,636
Sean Watters (seanwatters)

documentation

README

Encryptodon

npm crates.io docs.rs license

Pachyderm Goes Private 🐘🕶️

Encryption

// JavaScript (web)

import init, { decrypt, encrypt, generate_keys } from "https://unpkg.com/encryptodon@0.1.8/encryptodon.js";

(async () => {
    await init();

    const your_keys = generate_keys();
    const their_keys = generate_keys();

    // your end
    const status = "i'm a sneaky elephant 🐘👀";
    const encrypted_status = encrypt(status, their_keys.public, your_keys.private);

    // their end
    const decrypted_status = decrypt(encrypted_status, your_keys.public, their_keys.private);
    console.log(decrypted_status); // -> i'm a sneaky elephant 🐘👀
})();
// Rust (embedded)

let your_keys = encryptodon::generate_keys();
let their_keys = encryptodon::generate_keys();

// your end
let status = "i toot privately 🐘💨".to_string();
let encrypted_status = encryptodon::encrypt(status.clone(), their_keys.public(), your_keys.private()).unwrap();

// their end
let decrypted_status = encryptodon::decrypt(encrypted_status, your_keys.public(), their_keys.private()).unwrap();
println!(decrypted_status); // -> i toot privately 🐘💨

Bio Parsing

// JavaScript (web)

import init, { extract_key_from_bio } from "https://unpkg.com/encryptodon@0.1.8/encryptodon.js";

(async () => {
    await init();

    const bio = "i eat food. 🐘🔑:0bmKKWS04lZzoPC/KlS1kJgWN+XnvBw0yn4PPnot73E=";

    const key = extract_key_from_bio(bio);

    console.log(key); // -> 0bmKKWS04lZzoPC/KlS1kJgWN+XnvBw0yn4PPnot73E=
})();
// Rust (embedded)

let bio = "🐘🔑:0bmKKWS04lZzoPC/KlS1kJgWN+XnvBw0yn4PPnot73E=\nmore stuff...".to_string();

let key = encryptodon::extract_key_from_bio(bio).unwrap();

println!(key); // -> 0bmKKWS04lZzoPC/KlS1kJgWN+XnvBw0yn4PPnot73E=
Commit count: 0

cargo fmt