Re: TripleDES output size
- From: "Valery Pryamikov" <valery@xxxxxxxxx>
- Date: 10 Oct 2006 12:10:31 -0700
Actually, it is possible to securely encrypt a printable string to
another printable string (i.e. no need for base64) without any
expansion at all. The trick is to use cycle-walking ciper mode
(rigorous treatment in paper of Black, Rogaway - Encryption with
Arbitrary Domains) plus some other things that depends on your system
requirement such as maxim length of the string and others. However,
since you are new to cryptography, I would not recommend you to do it
yourself - too high risk of making things wrong.
-Valery.
http://www.harper.no/valery
Arturo Buonanni wrote:
On Mon, 9 Oct 2006 12:15:07 -0500, "Joe Kaplan"
<joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
It depends on how you are converting your string data to binary (what
encoding) and how you are converting your binary cipher data back to a
string.
If you are using UTF-8 for converting string to binary (generally a good
idea), then the downside there is that the binary data can be variable
length, depending on the characters in the string. If you use Unicode
encoding, then you should always get two bytes per character.
Then, you can figure out how many bytes of cipher data you'll get by
rounding up to the block size.
If you convert from your binary data to string with Base64 (which is
probably the best way to go, as it is smaller than hex string and won't
result in lossy conversion), then the base64 string will be 4/3 the size of
the binary data.
Make sense?
It makes perfect sense. Thanks.
I indeed use unicode encoding to feed the encryption provider and then
convert the binary data to string with Base64. It turns out to be:
CipherTextLength = _
((((Trunc((PlainTextLength * 2) \ 8) + 1) * 8) \ 3) + 1) * 4
The problem is that only now I realize I'm making my strings quite
big...:-(
Anyway, as I need to use Italian character set, I think I'm forced to
use at least UTF-8. In that case I should howerver consider the worst
case in wich every character of my string is a 2 byte code so I end up
having field the same size as using Unicode. :-(
.
- Follow-Ups:
- Re: TripleDES output size
- From: Arturo Buonanni
- Re: TripleDES output size
- References:
- TripleDES output size
- From: Arturo Buonanni
- Re: TripleDES output size
- From: Valery Pryamikov
- Re: TripleDES output size
- From: Arturo Buonanni
- Re: TripleDES output size
- From: Joe Kaplan
- Re: TripleDES output size
- From: Arturo Buonanni
- TripleDES output size
- Prev by Date: Re: TripleDES output size
- Next by Date: RE: Help me to understand ??
- Previous by thread: Re: TripleDES output size
- Next by thread: Re: TripleDES output size
- Index(es):
Relevant Pages
|