#wecom #decryption #api #we-com

wecom-crypto

企业微信API数据加解密库。

10 releases

0.1.9 Apr 6, 2024
0.1.8 Mar 21, 2024
0.1.6 Feb 22, 2024

#750 in Cryptography

Download history 392/week @ 2024-02-16 90/week @ 2024-02-23 26/week @ 2024-03-01 21/week @ 2024-03-08 231/week @ 2024-03-15 64/week @ 2024-03-22 15/week @ 2024-03-29 137/week @ 2024-04-05

449 downloads per month

MIT/Apache

10KB
129 lines

wecom-crypto

wecom-crypto提供了企业微信API数据的加解密功能。其实现完全遵循官方文档中的规定。

使用方法

use wecom_crypto::{CryptoAgent, CryptoSource};

let key = "cGCVnNJRgRu6wDgo7gxG2diBovGnRQq1Tqy4Rm4V4qF";
let agent = CryptoAgent::new(key);
let source = CryptoSource {
    text: "hello world!".to_string(),
    receive_id: "wandering-ai".to_string(),
};
let enc = agent.encrypt(&source);
let dec = agent.decrypt(enc.as_str()).unwrap();
assert_eq!(source, dec);

lib.rs:

wecom-crypto

wecom-crypto提供了企业微信API数据的加解密功能。其实现完全遵循官方文档中的规定。

使用方法

use wecom_crypto::{Agent, Source};

let token = "a";
let key = "cGCVnNJRgRu6wDgo7gxG2diBovGnRQq1Tqy4Rm4V4qF";
let agent = Agent::new(token, key);
let source = Source {
    text: "hello world!".to_string(),
    receive_id: "wandering-ai".to_string(),
};
let enc = agent.encrypt(&source);
let dec = agent.decrypt(enc.as_str()).unwrap();
assert_eq!(source, dec);

Dependencies

~1.4–2MB
~44K SLoC