crypto-marysue

Crates.iocrypto-marysue
lib.rscrypto-marysue
version0.2.0
sourcesrc
created_at2019-08-24 12:51:27.853175
updated_at2020-02-08 08:39:41.446492
descriptionPrime lib for Nyar
homepage
repositoryhttps://github.com/nyar-lang/nyar-prime
max_upload_size
id159379
size24,201
SasakiSaki (oovm)

documentation

README

Marysue™ Encoding

  • Encoding: UTF8 -> GB18030 -> BitXor -> BitXor -> BaseMap
extern crate crypto_marysue;
use crypto_marysue::{decode, encode};

#[test]
fn test_encoding() {
    let input = "力微任重久神疲, 再竭衰庸定不支.";
    let r1 = encode(input);
    let r2 = encode(input);
    debug_assert_ne!(r1, r2)
}

#[test]
fn test_decoding() {
    let secret = "晶凌娅萦弥·琉婷·清梅凝琴妙阳嫩音·淑颖宁凌·淑寇盘陌菁城·烟仪贞纱翠·佳素寂洛姬贞·碎墨";
    let raw = "力微任重久神疲, 再竭衰庸定不支.";
    debug_assert_eq!(decode(secret), raw)
}

There are thousands of possibilities in ciphertext, but there is only one corresponding information.

Notice that the version number used for encryption and decryption must be the same, because the key will keep expanding.

Commit count: 16

cargo fmt