aes_cbc_cipher 1.0.2+1 copy "aes_cbc_cipher: ^1.0.2+1" to clipboard
aes_cbc_cipher: ^1.0.2+1 copied to clipboard

The `AESCBCCipher` is a singleton class that provides AES encryption and decryption functionality using the `encrypt` package. It is used to encrypt and decrypt data using the AES (Advanced Encryption [...]

example/aes_cbc_cipher_example.dart

import 'package:aes_cbc_cipher/aes_cbc_cipher.dart';

String get _plainText => 'Hello World!';
void main(List<String> _) {
  //* MARK: - Initialization
  AESCBCCipher().init(
    key: '************************', // <----- Replace with your key
    iv: '****************', // <----- Replace with your iv
  );

  //* MARK: - Encryption
  print("Encrypting '$_plainText'...");
  final String encryptedText = AESCBCCipher().encrypt(_plainText);
  print("Encrypted Text: $encryptedText");

  //* MARK: - Decryption
  final String? decryptedText = AESCBCCipher().decrypt(encryptedText);
  print("Decrypting '$encryptedText'...");
  Future.delayed(
    const Duration(seconds: 2),
    () {
      //* MARK: - Result
      print("Decrypted Text: $decryptedText");
    },
  );
}
1
likes
130
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

The `AESCBCCipher` is a singleton class that provides AES encryption and decryption functionality using the `encrypt` package. It is used to encrypt and decrypt data using the AES (Advanced Encryption Standard) algorithm in CBC (Cipher Block Chaining) mode.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

crypto, encrypt, tuple

More

Packages that depend on aes_cbc_cipher