Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🦀🦀 High performance Crypto library of Rust implementation for Flutter

License

Notifications You must be signed in to change notification settings

tcdspring/r_crypto

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pub package GitHub GitHub top language GitHub language count

desc

Forked from https://github.com/TinoGuo/r_crypto, upgraded the Gradle (8.3) and Kotlin (2.0.0) versions.

Copied the pre-generated libcrypto.so from the r_crypto project on pub.dev to the corresponding directory under android/src/main/jniLibs.

r_crypto

Rust backend support crypto flutter library, much faster than Dart-implementation library, light-weight library.

Some crypto support hardware accelerate.

Support Algorithm

Hashes

  • MD5
  • SHA1
  • SHA2
    • SHA224
    • SHA256
    • SHA384
    • SHA512-trunc224
    • SHA512-trunc256
  • SHA3
    • SHA3-224
    • SHA3-256
    • SHA3-384
    • SHA3-512
    • SHAKE-128
    • SHAKE-256
    • KECCAK224
    • KECCAK256
    • KECCAK384
    • KECCAK512
  • Whirlpool
  • Blake2
    • Blake2b
    • Blake2s
  • Blake3
  • Groestl
    • Groestl224
    • Groestl256
    • Groestl384
    • Groestl512
    • GroestlBig
    • GroestlSmall
  • RIPEMD160 (RIPEMD-320 provides only the same security as RIPEMD-160)
  • Shabal
    • Shabal192
    • Shabal224
    • Shabal256
    • Shabal384
    • Shabal512

More digest will support soon.

Support Platform

  • Android
    • arm64-v8a
    • armeabi-v7a
    • x86
    • x86_64
  • iOS
    • arm64
    • x86_64
  • macOS
    • x86_64
    • arm64(WIP)
  • Windows
    • x86_64
    • x86(Not support now and feature)
  • Linux
    • x86_64

Example Usage

Hash

import 'package:r_crypto/r_crypto.dart';

// For fixed output length digest
rHash.hashString(HashType.MD5, input);
// For dynamic output length digest
rHash.hashString(HashType.blake3(length: 64), input);
// Also accept List<int> as parameter
rHash.hashList(HashType.KECCAK_224, [0,1,2]);
// Hash File
rHash.filePath(HashType.blake3(length: 32), path);

// Encode the list
hex.encode(list);

Note

  • Windows user needs to download the rcrypto.dll and put it in the same folder with *.exe. It's the limitation of the Flutter Windows Plugin now.

TODO

  • Support file input
  • Support encrypt/decrypt algorithm

About

🦀🦀 High performance Crypto library of Rust implementation for Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 34.0%
  • Dart 30.1%
  • C++ 15.0%
  • CMake 9.0%
  • Ruby 2.3%
  • Makefile 2.2%
  • Other 7.4%