Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.security > #209
| From | "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: AES encryption with J |
| Message-ID | <b4t7o4p9f2lejq01ed06cldls2a1pflvkj@4ax.com> (permalink) |
| Newsgroups | comp.lang.java.security |
| References | <a9704e17-a2ea-461b-8c07-b08322ff868a@r15g2000prh.googlegroups.com> |
| Date | 2011-04-27 16:08 +0000 |
| Organization | TDS.net |
To: comp.lang.java.security On Thu, 29 Jan 2009 13:22:32 -0800 (PST), Ranger <rangerdunadan@gmail.com> wrote, quoted or indirectly quoted someone who said : >I'm stumped. I'm pretty sure that if you encrypt plaintext that is 16 >bytes long you should receive ciphertext that is 16 bytes long. >However, I'm encrypting 16 byte plaintext and ending up with 32 byte >ciphertext. If I remove one character from the plaintext so it is 15 >bytes long I end up with a 16 byte ciphertext. for sample code that works see http://mindprod.com/jgloss/aes.html The essential problem is that encryption algorithm work on blocks, usually of some power of 2. If you message is not that size, you need to pad it, and when you decrypt it, discard the excess. That is handled automatically when you select a padding algorithm. -- Roedy Green Canadian Mind Products http://mindprod.com "Here is a point of no return after which warming becomes unstoppable and we are probably going to sail right through it. It is the point at which anthropogenic (human-caused) warming triggers huge releases of carbon dioxide from warming oceans, or similar releases of both carbon dioxide and methane from melting permafrost, or both. Most climate scientists think that point lies not far beyond 2#C (4#F) C hotter." ~ Gwynne Dyer --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.security | Previous | Next | Find similar
Re: AES encryption with J "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
csiph-web