Forums Register Login

trouble with decrypting with streams

+Pie Number of slices to send: Send
Greetings all,

So I writing a pair of methods to encrypt->base64encode and base64decode->decrypt a file.

encryptFile() works great at creating an encrypted-then-base64-encoded file


but I can't seem to get the corresponding decryptFile() method working correctly. It runs and appears to decode but not then decrypt


Can anyone spot what I'm doing wrong? As usual all suggestions, hints, constructive critism are all welcome.

TIA,

Still-learning Steve

+Pie Number of slices to send: Send
 

Stuart Rogers wrote:
So I writing a pair of methods to encrypt->base64encode and base64decode->decrypt a file.

encryptFile() works great at creating an encrypted-then-base64-encoded file


but I can't seem to get the corresponding decryptFile() method working correctly. It runs and appears to decode but not then decrypt


Can anyone spot what I'm doing wrong? As usual all suggestions, hints, constructive critism are all welcome.



My first instinct is to confirm that the keys and the padding are the same -- you didn't seem to show the code that creates those variables.

Henry
+Pie Number of slices to send: Send
First things I checked, yes , key and iv are indeed identical for en/de . Thanks for replying!


Regards,

Still-learning Steve
+Pie Number of slices to send: Send
Solved - merely removing the "true" parameters from the Base64InputStream and Base64OutputStream statements did the trick.


CASE CLOSED

Thanks to all who responded!

Still-learning Steve
If somebody says you look familiar, tell them you are in porn. Or in these tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 842 times.
Similar Threads
Overhead IO : The cryptic case of the extra bytes
RSA encryption
Decryption DESede doesn't work completely good ???
How to create SecretKey for AES 128 Encryption based on user's password??
problem in encryption of ZIP files.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:34:30.