Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #18882
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2012-09-21 10:15 -0700 |
| References | <k3a74r$u3s$1@news.m-online.net> <rjsj5819nsu0b14umojnd9bje44u7ttcae@4ax.com> <k3enr5$idj$1@news.albasani.net> <l6ko58ddes7ssnhomoh86u68m6eat339ie@4ax.com> |
| Message-ID | <1a980c9d-adfc-4411-aa84-08d3e912af28@googlegroups.com> (permalink) |
| Subject | Re: get hexadecimal hash string for a number |
| From | Lew <lewbloch@gmail.com> |
rossum wrote: > Magnus Warker wrote: >> What about Kevin's posting? He noted that encrypting sequential numbers >> would reveal the encryption key? > > Not with a secure encryption scheme. Knowing the plaintext gives a > 'known plaintext attack'. Both DES and AES can resist known plaintext > attacks. > >> Could you please explain this? I haven't used encryption in Java, but I >> would expect that the encryption method should be independend of the >> size of the data to encrypt? > DES and AES are block cyphers. DES uses a 64 bit block while AES uses > a 128 bit block. Any plaintext is padded to the next block and the > resulting cyphertext is always an exact number of blocks. If you are > encrypting 64 bit numbers, then use DES with no padding (since you > already have a full block). If you used AES for a 64 bit input then > you would get a 128 bit output. You could truncate it, but then there > is no guarantee of uniqueness. A block cypher is a keyed one-to-one > mapping between blocks, or is can be seen as a keyed permutation of > blocks. > > For variable sized cyphertext output you would need a stream cypher. > However, I would not suggest that as you will need a different > key/nonce for every number that you encrypt. Reusing a key/nonce is a > big mistake when using stream cyphers. > > Hasty Pudding cypher can be used with different block sizes, though it > is not common in crypto libraries. DES and AES are present in all > crypto libraries. Magnus, you need to understand how Usenet works. You are not going to learn all about cryptography by asking here. Best people here can do for you is point you to research areas. If you aren't googling like crazy over every keyword rossum fed you, then you are missing all the value offered. Study. Don't expect to be spoon-fed everything you need to know, especially not here. -- Lew
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
get hexadecimal hash string for a number Magnus Warker <magnux@mailinator.com> - 2012-09-18 18:25 +0200
Re: get hexadecimal hash string for a number markspace <-@.> - 2012-09-18 10:08 -0700
Re: get hexadecimal hash string for a number Lew <lewbloch@gmail.com> - 2012-09-18 10:14 -0700
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 19:58 -0400
Re: get hexadecimal hash string for a number markspace <-@.> - 2012-09-18 17:27 -0700
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 21:17 -0400
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 21:21 -0400
Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-19 08:27 +0200
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-19 18:30 -0400
Re: get hexadecimal hash string for a number Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2012-09-19 19:06 -0700
Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-20 11:32 +0200
Re: get hexadecimal hash string for a number Lew <lewbloch@gmail.com> - 2012-09-18 10:10 -0700
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 20:02 -0400
Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-19 08:18 +0200
Re: get hexadecimal hash string for a number Roedy Green <see_website@mindprod.com.invalid> - 2012-09-18 10:23 -0700
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 20:00 -0400
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 20:06 -0400
Re: get hexadecimal hash string for a number markspace <-@.> - 2012-09-18 17:30 -0700
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 21:07 -0400
Re: get hexadecimal hash string for a number Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2012-09-18 22:50 -0700
Re: get hexadecimal hash string for a number Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-09-19 01:06 -0500
Re: get hexadecimal hash string for a number rossum <rossum48@coldmail.com> - 2012-09-19 17:34 +0100
Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-20 11:30 +0200
Re: get hexadecimal hash string for a number rossum <rossum48@coldmail.com> - 2012-09-21 12:48 +0100
Re: get hexadecimal hash string for a number Lew <lewbloch@gmail.com> - 2012-09-21 10:15 -0700
Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-26 06:11 +0200
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-26 09:29 -0400
Re: get hexadecimal hash string for a number Gene Wirchenko <genew@ocis.net> - 2012-09-26 09:18 -0700
Re: get hexadecimal hash string for a number markspace <-@.> - 2012-09-21 10:56 -0700
Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-26 06:12 +0200
Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-23 20:57 -0400
csiph-web