steel_crypt 0.5.1 copy "steel_crypt: ^0.5.1" to clipboard
steel_crypt: ^0.5.1 copied to clipboard

outdated

A collection of high-level API's exposing PointyCastle/encrypt to perform hashing and encrypting in popular and/or secure algorithms.

example/example.dart

import 'package:steel_crypt/steel_crypt.dart';

main() {

  var private = CryptKey().genKey();


  var encrypter = SymCrypt(private, 'AES');

  var encrypter2 = RsaCrypt();


  var hasher = HashCrypt();

  var hasher2 = HashCrypt('SHA-3/256');


  var iv = CryptKey().genIV(16);


  //Print key
  print ("Key:");

  print(private);

  print("");


  //SHA-3 512 Hash
  print("SHA-3 512 Hash:");

  print(hasher.hash('word'));

  var hash = hasher.hash('word');

  print(hasher.checkpass('word', hash));

  print("");


  //HMAC SHA-3 256 Hash
  print("HMAC SHA-3 256 Hash:");

  print(hasher2.hashHMAC('word', private));

  print("");


  //AES Symmetric
  print("AES Symmetric:");

  print(encrypter.encrypt('word', iv));

  String crypted = encrypter.encrypt('word', iv);

  print(encrypter.decrypt(crypted, iv));

  print("");


  //RSA Asymmetric
  print("RSA Asymmetric:");

  var crypted2 = encrypter2.encrypt("word", encrypter2.pubKey);

  print(crypted2);

  print(encrypter2.decrypt(crypted2, encrypter2.privKey));

  print("");
}
70
likes
0
pub points
92%
popularity

Publisher

verified publisherkishoredev.live

A collection of high-level API's exposing PointyCastle/encrypt to perform hashing and encrypting in popular and/or secure algorithms.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

encrypt, pointycastle

More

Packages that depend on steel_crypt