Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Question About javax.crypto.Cipher

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to learn about the Cipher library and discovered something that to me seems strange. Playing around I inadvertently encrypted my encryption key. I then discovered that if I try to decrypt that, the result is null (no exception thrown). In other words decrypting the encryption key resulted in a null decrypted string. I don't know why that would be a practical thing to do but from an academic standpoint, would one expect that to be normal behavior? Logically I don't see why that would happen. A string is a string. TIA.
 
Saloon Keeper
Posts: 12030
257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give us a small program that we can compile and run that illustrates what you've described?
 
Sam Ritter
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I will when I get back to that.
 
Stephan van Hulst
Saloon Keeper
Posts: 12030
257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How's it going Sam?
 
Sam Ritter
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't had a chance to get back to it yet.
 
Sam Ritter
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I finally returned to this project. Fortunately (for me), I had to make some seemingly unrelated changes and can no longer reproduce the problem. Obviously those changes were not entirely unrelated somehow but it is not worth pursuing at this point.
 
I love a good mentalist. And so does this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic