Last updated:
0 purchases
flutter cipher
flutter_cipher #
一个Flutter加密类库
A Flutter encryption class library
Getting Started #
兼容iOS和Android
Compatible with iOS and Android
RSA:
密钥格式: PKCS#1
Key format: PKCS#1
案例:
example:
Asymmetric rsa = Cipher.getAsymmetricInstance(RSA(publicKey: publicKey, privateKey: privateKey));
//encryption
var encryptPublic = rsa.encryptPublic(content);
var encryptPrivate = rsa.encryptPrivate(content);
//decrypt
var decryptPublic = rsa.decryptPublic(encryptPrivate);
var decryptPrivate = rsa.decryptPrivate(encryptPublic);
copied to clipboard
AES:
案例:
example:
Key key = Key.fromUtf8('32 length key................');
IV iv = IV.fromLength(16);
Symmetry aes = Cipher.getSymmetryInstance(AES(key, iv)));
var encrypted = aes.encrypt(bytes);
var encrypted = aes.encryptString(str);
var content = aes.decrypt(encrypted);
var content = aes.decrypt2String(encrypted);
copied to clipboard
Finally, we would like to thank leocavalcante, as the main content of this library is derived from the encrypt library.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.