• Post Reply Bookmark Topic Watch Topic
  • New Topic

trouble with decrypting with streams  RSS feed

 
Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First things I checked, yes , key and iv are indeed identical for en/de . Thanks for replying!


Regards,

Still-learning Steve
 
Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!