On Wed September 30 2009, Kenneth Goldman wrote:
> owner-openssl-us...@openssl.org wrote on 09/30/2009 03:27:56 AM:
> 
> > On Fri, Sep 18, 2009 at 01:59:12PM -0700, musikit wrote:
> > >
> > > again works awesome for strings. however we are realizing there are
> > > sometimes we just want a 32 bit int or a 64 bit int encrypted and
> nothing
> > > else.
> >

You might want to use some representation other than binary for your
integers.  There are a lot of ways to do that, perhaps pick something
that will give you a reasonable (for cryptographic purposes) length.

One possibility; I once posted a document that describes extending UTF-8
(within the bounds of the Unicode version 4 standard) to include 32 bit 
binary data as an xUTF-8 character representation.

That will give you a longer than 4 byte (or 8 byte) sequence to use with
any block encryption method.  It might even be obscure enough un-encoded
to suit your purpose.  ;)

Also, any UTF-8 standards compliant string reader will just happly skip
the binary data (usually by substituting non-breaking space or unknown 
character).
At least it will if it understands the full encoding scheme, most don't, yours 
could.

Note: The (v4) standard allows the unused parts of the encoding scheme to be 
used locally 
and also externally by prior agreement.  Which is how I got 32 bit integers 
into it.

Mike

> > You could just xor the bits with the key.
> 
> With XOR, you can toggle a bit in the cleartext by
> toggling a bit in the ciphertext.  This property may or may not be
> important to you.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to