| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version |
Arguments: encrypted &key key end context (pad t) string in-place (external-format :utf-8) (mode :ecb) iv
This function decrypts encrypted, which should be an (unsigned-byte 8) array returned by a call to blowfish-encrypt.
This function returns one or two values, as the string keyword argument is true or false. If string is true, a string is returned as the only returned value. If string is false, an (unsigned-byte 8) array representing the decryption and an integer specifying how many bytes there are in the decrypted result are returned. The second returned value is the length of the array returned as the first returned value when the in-place keyword argument is false, and is a value less than or equal to the length when in-place is true.
The arguments are:
nil
.
If an integer, the length of the encrypted portion of
encrypted (the same value as the second value
returned by blowfish-encrypt). If nil
, then the whole of encrypted
is used. (The in-place argument to both this function and
to blowfish-encrypt allows
using an existing (unsigned-byte 8) array, which may be larger than
necessary to hold the encrypted value. This argument allows you to
specify the actual encrypted portion and ignore the remainder of the
array.)
t
): the
value should be the same as was passed as the pad
argument to blowfish-encrypt. It tells whether the
encrypted value was padded out to have an octet length of 8.
:utf-8
external format, and the resulting string is
returned as the single returned value. If nil
, the raw (unsigned-byte 8) array is returned as
the first value and the length of the decrypted portion in the array
is returned as the second value.
nil
, the
second returned value (the number of bytes in the decryption) may be
less than the length of the first returned value.
:utf-8
and that is in
general a good choice. When
:default
is specified, the value returned by
(find-external-format :default)
is used
(see find-external-format).
That value is not recommended because the value of the default
external format (which depends on the value of *locale*
) may change between
encryption and decryption.
:ecb
, meaning use
ECB. Specify :cbc
for CBC. The text must be
decrypted in the same mode as was used for encryption. If CBC
encryption mode is requested, the initialization vector (IV) must be
provided by using keyword argument iv. The IV
must be an (unsigned-byte 8) array of at least 8 elements. The IV will be
modified so that it may be used for subsequent encrypt/decrypt
calls.
:cbc
. When mode is
:cbc
, the value, called the initialization vector
or IV, must be the same (unsigned-byte 8) array of at least 8 elements
as was usedf for encryption. The IV will be modified so that it
may be used for subsequent encrypt/decrypt calls.
See also blowfish-encrypt and blowfish-init.
See also the new auxilliary functions hex-string-to-usb8-array and usb8-array-to-hex-string.
See Support for Blowfish encryption in miscellaneous.htm for information on Blowfish encryption and Blowfish encryption support in Allegro CL. There are examples of blowfish encryption and decryption in that section. Support for encryption in the same document discusses encryption support in Allegro CL in general.
Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version |