2 个不稳定版本
0.2.0 | 2020年9月22日 |
---|---|
0.1.0 | 2020年2月8日 |
#2171 在 加密学 中
在 crypto-marysue 中使用
8KB
141 行
加密随机映射
- 编码: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)
}
在密文中存在数千种可能性,但只有一种对应的信息。
请注意,用于加密和解密的版本号 必须相同,因为密钥将不断扩展。
依赖项
~530KB