affinidi_tdk_cryptography 3.0.0 copy "affinidi_tdk_cryptography: ^3.0.0" to clipboard
affinidi_tdk_cryptography: ^3.0.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');
}
6
likes
160
points
424
downloads

Documentation

API reference

Publisher

verified publisheraffinidi.com

Weekly Downloads

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

Repository (GitHub)
View/report issues
Contributing

License

Apache-2.0 (license)

Dependencies

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

More

Packages that depend on affinidi_tdk_cryptography