Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
60 views

Java encrypt a zip file then decrypt with openssl

The goal is to be able to encrypt a Zip file in Java, and decrypt it elsewhere using openssl or Python. I use the following to (hopefully) encrypt a ZIP file in Java, cobbled together from a couple ...
TenG's user avatar
  • 4,004
1 vote
1 answer
79 views

Decrypt Java produced AES file with openssl

The following Java produces encryoted data: private static final int KEY_LENGTH = 256; private static final int ITERATION_COUNT = 65536; public static String encrypt(String strToEncrypt, String ...
TenG's user avatar
  • 4,004
1 vote
1 answer
55 views

Decrypt a Java encrypted file in Python

I use the following to encrypt a file in Java: public static byte[] hexStringToByteArray(String s) { int len = s.length(); byte[] data = new byte[len / 2]; for (int i = 0; i <...
Pro West's user avatar
  • 419
1 vote
2 answers
303 views

java Cannot find any provider supporting Serpent/CTR/NoPadding

sshj logs Cannot find any provider supporting CAST5/CTR/NoPadding Cannot find any provider supporting IDEA/CTR/NoPadding Cannot find any provider supporting Serpent/CBC/NoPadding Cannot find any ...
Jigar Shah's user avatar
  • 2,664
1 vote
2 answers
472 views

javax.crypto - Cipher objects - How does the Provider Service work?

I am trying to find the implementations of the source code. For example, if I initialize the Cipher-object like this: Cipher cipher = Cipher.getInstance("AES/CTR/NoPadding"); how can I find ...
schegga_BC's user avatar
0 votes
1 answer
77 views

BadPaddingException when reading CipherInputStream during decryption

I'm new to Java cryptography and don't know why I keep getting BadPaddingException when attempting to decrypt a file that I have successfully encrypted, using the same key and IV for both. I am adding ...
iceyjc's user avatar
  • 3
2 votes
1 answer
190 views

Migrate java decryption from openssl (>1.1.1 with -md sha256) to (<1.1.1 with --pbkdf2) doesn't work

I am migrating a java code that encrypts and decrypts messages just as openssl below 1.1.1 with this command : echo -n "password" | openssl enc -aes-256-cbc -a -k secretKey -md sha256 This ...
Illidan's user avatar
  • 169
0 votes
1 answer
812 views

javax.crypto.IllegalBlockSizeException: Input length not multiple of 16 bytes - AES_256/CBC/NoPadding

I am trying to decrypt an AES cipher in Java. The cipher was encrypted/decrypted in PHP using the openssl_encrypt/openssl_decrypt function. An example of decryption in PHP looks like this: function ...
Mohamed E.'s user avatar
1 vote
0 answers
51 views

Is there a class containing statics for algorithm names/modes/paddings?

If I needed to reference an encoding, like UTF-8, I'd typically reference the StandardCharset.UTF-8 static, not use a String literal "UTF-8". When working with cipher transformations, I see ...
Shaun's user avatar
  • 167
2 votes
1 answer
2k views

Generating key from password without salt

Java has a convinient class PBEKeySpec that lets you generate a secret key from a password using values of iteration count, key length and salt for decryption purposes. See the example below. private ...
arturheath's user avatar
0 votes
0 answers
494 views

Is it possible to use javax.crypto.Cipher RSA 1024 to decrypt the message with the public key? Maybe public key can be used for encryption only?

I have Delphi client/software suite that uses RSA 1024 private and public keys in the following protocol (client has public key, server has private key): client generates string A and encrypts it ...
TomR's user avatar
  • 3,276
1 vote
1 answer
787 views

How to configure Android RSA key generation (or key use) so that it works like Delphi TurboPower Lockbox 2 RSA key generation/use?

I have the following code for Delphi 10.2 TurboPower LockBox 2 RSA keys generation and their represenation as some string: //Object properties object LbRSA1024: TLbRSA PrimeTestIterations = 20 ...
TomR's user avatar
  • 3,276
0 votes
0 answers
66 views

How can I use javax.crypto to encrypt images?

I need a program that could encrypt images, and after a somewhat brief amount of research I stumbled upon the javax.crypto library. I need it be absolutely secure. Could I use this library, and if ...
Hera Sutton's user avatar
0 votes
0 answers
1k views

Python equivalent to java encryption

In my company, we have java class for encrypt/decrypt-ing small strings such as passwords. Running the java code through a debugger, I can get the encrypted string, and the decrypted string. I then ...
a693673's user avatar
  • 167
1 vote
0 answers
121 views

Why does PBEWithMD5AndDES mess up encryption in parallelStream in Java?

I am working in a Spring Boot project where we use the PBEWithMD5AndDES encryption algorithm. We use the javax.crypto.Cipher class library like the code below. When we process single requests it works ...
Hevv's user avatar
  • 41

15 30 50 per page
1
2 3 4 5 6