On Aug 13, 8:07 am, Nguyên Nguyễn Văn Cao wrote:
> I was successful with the example about AES<
http://raycompstuff.blogspot.com/2009/12/golang-cryptoaes.html>.
> As I can see if the lenght of message which you want to encrypt > BlockSize
> (16 for AES pkg) I must split the message, is it right?
No. Block size defines the length of the key used for encryption.
See the functions encrypt/decrypt here, which also does a trick to
include a random initialization vector to the resulting encrypted
message:
http://goo.gl/5zfWH
> For a secure web cookies, what pkg should I use?
I'm biased, but I think you should check gorilla/securecookie (which
only performs serialization/(optional)encryption/hashing/encoding for
a secure cookie value), or gorilla/sessions, which uses gorilla/
securecookie to set convenient sessions.
http://gorilla-web.appspot.com/pkg/securecookie
http://gorilla-web.appspot.com/pkg/sessions
-- rodrigo