[Glass] Encryption in GemStone

Paul DeBruicker pdebruic at gmail.com
Wed Nov 20 10:54:22 PST 2013


Mariano Martinez Peck wrote
> 
> Paul, may I ask if at least you could encrypt multiple chunks of 8 chars?
> For example:
> 
> 
> | enc encryptedString key decrString |
> key:='mySecretKey'.
> enc:=Blowfish encryptString:'1234567812345678' with: key.
> encryptedString := enc asByteArray asString.
> Transcript show: ' encrypted:  ', encryptedString; cr.
> decrString:=Blowfish decryptString: encryptedString with: key.
> Transcript show: ' decrypted:  ', decrString; cr.
> 
> 
> I would love if you would be able to encrypt the whole string...I mean,
> you
> encrypt as much multiples of 8 as you can, and only let the rest (always
> will be smaller than 8 chars) unencrypted...
> 
> is that doable without much work?
> 
> Thanks
> -- 
> Mariano
> http://marianopeck.wordpress.com


The wikipedia article I posted is all I know about it.  It doesn't seem like
too much work.  You need a way to make a random 8 byte initialization vector
(nonce).  Then it looks like you just xor the first 8 byte block of your
plaintext with the intialization vector and encrypt the result of the xor
calculation to get an encrypted 8 byte block. With the newly encrypted 8
byte block you: 1. store it in your encrypted string and 2. use it in place
of the initialization vector for the next block of your plaintext.  Then
keep doing that xor, encrypt, store, move to next 8 byte block cycle until
you reach the end of your string.  You could probably even pad your string
to a multiple of 8 bytes before starting to be able to encrypt everything. 
Then when decrypting you do the opposite.  I think you need a way to store
the initialization vector at the start or end of the encrypted string to use
when decrypting.

 It seems like a fun problem to solve but not one I have time for now.  

Does that help?

Paul
 



--
View this message in context: http://forum.world.st/Glass-Encryption-in-GemStone-tp4723580p4723820.html
Sent from the GLASS mailing list archive at Nabble.com.


More information about the Glass mailing list