Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/prongbang/aes_ctr

AES CTR - Counter Flutter plugin.
https://github.com/prongbang/aes_ctr

aes-ctr aes-ctr-mode cryptography decryption encryption flutter

Last synced: 24 days ago
JSON representation

AES CTR - Counter Flutter plugin.

Awesome Lists containing this project

README

        

# aes_ctr

AES CTR - Counter Flutter plugin.

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/prongbang)

## Usage

```dart
import 'dart:async';
import 'dart:typed_data';
import 'package:aes_ctr/aes_ctr.dart';

void main() async {
var plaintext = "aes ctr - counter";

int counter = 5;

// 128-bit = (16 bytes * 8 bits/byte), 192-bit and 256-bit secretKey
Uint8List secretKey = Uint8List.fromList([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);

var cipher = await AesCtrCryptography.encrypt(counter, secretKey, plaintext);
var decrypt = await AesCtrCryptography.decrypt(counter, secretKey, cipher);
print(decrypt);
}
```