pointycastle is a Dart package for common cryptographic operations. Most of the classes are ports of Bouncy Castle from Java to Dart.
Questions tagged [pointycastle]
27 questions
5
votes
1 answer
Input data length must be a multiple of cipher's block size in AES CTR
I encrypt a string using Dart's encrypt package. The code I encrypted is below.
String encrypt(String kelime) {
final key = Key.fromUtf8('H4WtkvK4qyehIe2kjQfH7we1xIHFK67e'); //32 length
final iv = IV.fromUtf8('HgNRbGHbDSz9T0CC');
final…

Stick
- 154
- 1
- 8
3
votes
0 answers
Dart: PointyCastle export Diffie-Hellman keys to PEM
I'm trying to export Diffie-Hellman(modular version) keys to PEM format, using PointyCastle, since it offers ASN1 serialization/deserialization.
This is my method for the conversion (for DhPublicKey):
Uint8List toSpki() {
ASN1Sequence outer =…

mrpurpleknight
- 31
- 3
3
votes
3 answers
Compatible AES encryption and decryption for Flutter and javascript
I am trying to write two functions in flutter and Javascript which I can use throughout my project to encrypt or decrypt data using AES when data is exchanged.
For Flutter, I am using the pointycastle package based on…

Nguyen Phạm
- 45
- 1
- 2
- 7
2
votes
0 answers
PointyCastle seems very slow compared to another AES software implemented package
I had another question posted at Throughput for PointyCastle's aes cbc? but I don't consider this a duplicate.
I am trying to encrypt files using AES-CBC in flutter and came across the PointyCastle and Cryptography packages. Both appear to be…

mirkaim
- 145
- 1
- 10
2
votes
0 answers
SHA-384/PSS Signature verification using PointyCastle in Dart
I have a public key, a message and a signature. I want to verify that the signature is correct using SHA-384/PSS signer from PointyCastle.
I managed to build something but the signature verification fails and I suppose it is because of salt…

Gyuri Majercsik
- 2,141
- 1
- 17
- 29
2
votes
1 answer
How to encrypt and decrypt using AES CBC 256bit and PKCS5Padding in dart and also retrieve parameters
I have some java code which I am trying to replicate in Dart (class can be found at here)
/**
* Encrypt object with password
* @param data Object to be encrypted
* @param secret Password to use for encryption
* @return…

Fern
- 93
- 6
- 16
1
vote
1 answer
"crypto/rsa: decryption error" when trying to use rsa encryption and decryption in dart (pointycastle) and golang
I'm trying to encrypt a message in dart (using pointycastle) and decrypt it in golang (using the standard library). The private and public keys do match. The message is sent over TCP.
dart code:
// import 'package:encrypt/encrypt.dart' as enc;
final…

Vandermondium
- 11
- 3
1
vote
1 answer
Dart: Encrypt and decrypt in AES with PointyCastle plug-in
I am trying to perform encryption and decryption using the plug-in that I will show you below.
The decryption works perfectly for me as I have used an AES cipher from my backend and it converts it perfectly.
The problem is the following:
When you…

DomingoMG
- 1,827
- 2
- 23
- 44
1
vote
2 answers
Uint64List not supported on flutter web
i have an error with Uint64List in flutter Web (in pointycastle lib)
var length = Uint8List.view((Uint64List(2)..[0] = iv.length * 8).buffer);
"Error: Unsupported operation: Uint64List not supported on the…

redDwarf
- 336
- 1
- 9
1
vote
2 answers
how to convert AsymmetricKeyPair to base64 encoding string in dart
I‘m a rookie in PointyCastle,how can I generate ecc base64 key pairs with PointyCastle in dart
AsymmetricKeyPair generateKeyPair({curve = 'secp256r1'}) {
var param = curve == 'secp256r1' ? ECCurve_secp256r1() :…

John
- 645
- 1
- 8
- 23
1
vote
1 answer
Encryption in Flutter and Decryption in java (AES-256)
I am trying to implement encryption in Flutter, I'm using java as a backend and dart for the mobile application. I have taken code from this Encryption in Java and Decryption in Flutter (AES-256)
But it only supplies decryption in Flutter, and I…

yong ho
- 3,892
- 9
- 40
- 81
1
vote
1 answer
How to import randomly generated 4096bit Java RSA public key from String
I have a network app that I'm trying to use with Java and Flutter and encryption. I'm using a 4096 bit RSA randomly generated keypair in Java and I'm using it to encrypt a randomly generated AES 256 bit key
I only need the Dart code as the Java code…

Fern
- 93
- 6
- 16
1
vote
1 answer
Get RSA Public or Private Key from KeyPair Generation Flutter
I have added pointycastle and generated a keypair, encrypting the trial "Hello World" string. From this, I want to get the values of the Private and Public Key. Is there anywhere they are stored, because whenever I try to print the values of…

Epic Gamer_1
- 104
- 3
- 12
1
vote
1 answer
Encrypting binary array with AES ECB in Dart
I'm looking for a way to encrypt a binary array in Dart. I've had a look at some of the more common libraries such as https://pub.dartlang.org/packages/encrypt, but many of them can only handle AES keys and data in String form, not binary arrays.…

heinz_dieter
- 315
- 1
- 4
- 12
0
votes
0 answers
Throughput for PointyCastle's aes cbc?
I'm trying to encrypt files with the PointyCastle package for flutter. I don't see any information anywhere for throughput benchmarks but when testing a 100mb file, it is taking about 10 seconds which seems very high compared to another flutter aes…

mirkaim
- 145
- 1
- 10