fhel 0.0.7 copy "fhel: ^0.0.7" to clipboard
fhel: ^0.0.7 copied to clipboard

Natively supports Fully Homomorphic Encryption operations on sensitive data without revealing it. Supports Key Derivation, Encryption, Decryption, and Mathematical operations.

FHEL #

A Fully Homomorphic Encryption Library (FHEL) interface that exposes the basic functionalities of Microsoft SEAL. Supports Android and Linux.

Usage #

To use this plugin, add fhel as a dependency in your pubspec.yaml

Download Binaries #

Stored in Github Releases

flutter pub add fhel
dart run fhel:setup <platform> --arch <architecture>
Platform Architecture
Android x86_64 arm64-v8a armeabi-v7a
Linux x64
MacOS x64
import 'package:fhel/seal.dart';

// Generate context w/ parameters
Map<String, int> ctx = {
'polyModDegree': 4096,
'ptMod': 1024,
'secLevel': 128
};
// SEALContext with BFV Scheme
final bfv = Seal('bfv');

// Initialize context and verify
String status = bfv.genContext(ctx);
assert(status == 'success: valid', status);

// Generate public/private keys
bfv.genKeys();

// Create Plaintext obj, contains pointer C obj in memory
final plainOne = bfv.plain(2.toRadixString(16));
final plainTwo = bfv.plain(2.toRadixString(16));

// Create Ciphertext obj, contain pointer to SEALCiphertext
final cipherOne = bfv.encrypt(plainOne);

// Add Ciphertexts, enc(1) + 2 = enc(3)
final cipherAdd = bfv.addPlain(cipherOne, plainTwo);
final plainAdd = bfv.decrypt(cipherAdd);

// Decode Plaintext to int
final result = int.parse(plainAdd.text, radix: 16);
assert(result == 4, result);

2
likes
0
points
86
downloads

Publisher

verified publisherjeffmur.dev

Weekly Downloads

Natively supports Fully Homomorphic Encryption operations on sensitive data without revealing it. Supports Key Derivation, Encryption, Decryption, and Mathematical operations.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

archive, args, ffi, flutter, path, stack_trace

More

Packages that depend on fhel