Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.security > #209

Re: AES encryption with J

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx01.iad01.newshosting.com!newshosting.com!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Subject Re: AES encryption with J
Message-ID <b4t7o4p9f2lejq01ed06cldls2a1pflvkj@4ax.com> (permalink)
X-Comment-To comp.lang.java.security
Newsgroups comp.lang.java.security
In-Reply-To <a9704e17-a2ea-461b-8c07-b08322ff868a@r15g2000prh.googlegroups.com>
References <a9704e17-a2ea-461b-8c07-b08322ff868a@r15g2000prh.googlegroups.com>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 33
Date Wed, 27 Apr 2011 16:08:46 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303920526 96.60.20.240 (Wed, 27 Apr 2011 11:08:46 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 11:08:46 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.security:209

Show key headers only | View raw


  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


Thread

Re: AES encryption with J "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000

csiph-web