Ordinal Crypto 🔐
The cryptography library for the Ordinal Platform
Usage
let = generate_exchange_keys;
let = generate_fingerprint;
let content = vec!;
let pub_keys = vec!;
let mut encrypted_content =
encrypt.unwrap;
let encrypted_content =
extract_content_for_key_position
.unwrap;
let decrypted_content = decrypt
.unwrap;
assert_eq!;
Format
- nonce = 24 bytes
- one-time public key = 32 bytes
- keys count header = 2-9 bytes
- size = 1 byte (1 | 2 | 4 | 8)
- big endian bytes = 1-8 bytes
- encrypted keys = pub_keys.len() * 72 bytes (max is 65,535 or 4.71852 mb)
- nonce = 24 bytes
- encrypted key = 32 bytes
- Poly1305 MAC = 16 bytes
- inner signature = 64 bytes (encrypted along with the content to preserve deniability)
- encrypted content = content.len()
- Poly1305 MAC = 16 bytes
Security
THIS CODE HAS NOT BEEN AUDITED OR REVIEWED. USE AT YOUR OWN RISK.