mirrored from https://www.bouncycastle.org/repositories/bc-java
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
String staticVector = "lbsTNi0WXIg=";
String password = "HJQScqUp1l3zfy27RA4dvAE251WW2T+rKb7JQOXgvMQB7hCl/VFQE3WXyAL4PYRmIo8gK/kqQu/UykAiThrDYOVynrUED0Cg==KiT2on42Kp";
String inputTextMsg = "Hi";
SecureRandom consistentSecureRandom = new ConsistentByteProvider(Base64.decodeBase64(staticVector));
JcePGPDataEncryptorBuilder builder = new JcePGPDataEncryptorBuilder(PGPEncryptedData.CAST5);
builder.setWithIntegrityPacket(false);
builder.setSecureRandom(consistentSecureRandom);
PGPEncryptedDataGenerator generator = new PGPEncryptedDataGenerator(builder);
generator.setForceSessionKey(false);
JcePBEKeyEncryptionMethodGenerator method = new JcePBEKeyEncryptionMethodGenerator(
password.toCharArray(),
1
);
method.setSecureRandom(consistentSecureRandom);
generator.addMethod(method);
ByteArrayOutputStream encOut = new ByteArrayOutputStream();
OutputStream cOut = generator.open(encOut, new byte[1024]);
cOut.write(inputTextMsg.getBytes());
cOut.close();
byte[] encrypted = encOut.toByteArray();After bouncycastle 1.80, i believe we changed the way we generate OPENPGP encrypted cipherTexts (i mostly think it's because of => #1938) ?
I could see this because if i run the above code in 1.78 encrypted byte size is 40 byte and the same code in 1.80 it gives me 64 bytes !! Yes, i can still decrypt the msg encrypted using 1.78 !! but i would like to have a simple toggle to bring back the old behaviour !
Do you guys have a way to bring back the old behaviour ? If there is a toggle to bring back the old packet size it would be better !
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working