u8vector encrypt blowfish - part-cw/lambdanative GitHub Wiki
(u8vector-encrypt-blowfish keyidx vect)
u8vector-encrypt-blowfish encrypts an u8vector using Blowfish
Parameter | Description |
---|---|
keyidx | Key index (0-15), 0 unless more than one encryption key is used |
vect | u8vector to be encrypted |
Example
Example 1: Setup blowfish encryption key, encrypt a string and decrypt it again. Requires libcrypto to be in the consoles' LIBRARIES file and rupi to be in the console's MODULES file.
> (u8vector-setkey-blowfish 0 (string->u8vector "BlowFish"))
> (define mystring "The brown fox jumps over the lazy dog!")
> (define encrypted (u8vector-encrypt-blowfish 0 (string->u8vector mystring)))
> (display encrypted)
> (define decrypted (u8vector->string (u8vector-decrypt-blowfish 0 encrypted)))
> (string=? mystring decrypted)