affinidi_tdk_cryptography 2.4.0 copy "affinidi_tdk_cryptography: ^2.4.0" to clipboard
affinidi_tdk_cryptography: ^2.4.0 copied to clipboard

Cryptography package for Affinidi TDK that provides cryptographic functionalities for secure token management, encryption and decryption.

example/main.dart

import 'dart:convert';
import 'package:affinidi_tdk_cryptography/affinidi_tdk_cryptography.dart';

Future<void> main() async {
  final cryptographyService = CryptographyService();

  const password = 'password';
  const salt = 'fixed_salt';
  const dataToEncrypt = 'Hello, Affinidi!';

  // Derive encryption key using PBKDF2
  final encryptionKey = await cryptographyService.Pbkdf2(
    password: password,
    nonce: utf8.encode(salt),
  );

  // Encrypt the data
  final encryptedData = await cryptographyService.Aes256EncryptStringToHex(
    key: encryptionKey,
    data: dataToEncrypt,
  );

  print('Encrypted Data: $encryptedData');

  // Decrypt the data
  final decryptedData = await cryptographyService.Aes256DecryptStringFromHex(
    key: encryptionKey,
    encryptedData: encryptedData,
  );

  print('Decrypted Data: $decryptedData');
}
4
likes
160
points
442
downloads

Publisher

verified publisheraffinidi.com

Weekly Downloads

Cryptography package for Affinidi TDK that provides cryptographic functionalities for secure token management, encryption and decryption.

Repository (GitHub)
Contributing

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

bs58, convert, crypto, cryptography, dart_jsonwebtoken, jwt_decoder, pointycastle, secp256k1

More

Packages that depend on affinidi_tdk_cryptography