Oracle 5.0 Reference Manual page 975

Table of Contents

Advertisement

The return string is a binary string where the first character is
error occurs,
DES_ENCRYPT()
The 128 is added to make it easier to recognize an encrypted key. If you use a string key,
is 127.
The string length for the result is given by this formula:
new_len
=
orig_len
Each line in the DES key file has the following format:
key_num des_key_str
Each
value must be a number in the range from
key_num
order.
des_key_str
space between the number and the key. The first key is the default key that is used if you do not
specify any key argument to
You can tell MySQL to read new key values from the key file with the
statement. This requires the
One benefit of having a set of default keys is that it gives applications a way to check for the
existence of encrypted column values, without giving the end user the right to decrypt those values.
mysql>
SELECT customer_address FROM customer_table
>
WHERE crypted_credit_card = DES_ENCRYPT('credit_card_number');
ENCODE(str,pass_str)
Encrypt
using
str
pass_str
The result is a binary string of the same length as str.
The strength of the encryption is based on how good the random generator is. It should suffice for
short strings.
ENCRYPT(str[,salt])
Encrypts
using the Unix
str
must be a string with at least two characters or the result will be NULL. If no
a random value is used.
mysql>
SELECT ENCRYPT('hello');
-> 'VxuFAJXVARROc'
[955]
ignores all but the first eight characters of str, at least on some systems. This
ENCRYPT()
behavior is determined by the implementation of the underlying
The use of
ENCRYPT()
the system call expects a string terminated by a zero byte.
If
is not available on your system (as is the case with Windows),
crypt()
always returns NULL.
[955]
MD5(str)
Calculates an MD5 128-bit checksum for the string. The value is returned as a binary string of 32 hex
digits, or
if the argument was NULL. The return value can, for example, be used as a hash key.
NULL
See the notes at the beginning of this section about storing hash values efficiently.
mysql>
SELECT MD5('testing');
-> 'ae2b1fca515949e5d54fb22b8ed95575'
Encryption and Compression Functions
[954]
returns NULL.
+ (8 -
(orig_len
% 8)) + 1
is the string that is used to encrypt the message. There should be at least one
DES_ENCRYPT()
[577]
privilege.
RELOAD
[955]
as the password. To decrypt the result, use
[955]
system call and returns a binary string. The
crypt()
[955]
with the
ucs2
955
CHAR(128 | key_num)
to 9. Lines in the file may be in any
0
[954].
crypt()
multi-byte character set is not recommended because
[886]. If an
key_num
FLUSH DES_KEY_FILE
[954].
DECODE()
argument
salt
argument is given,
salt
system call.
[955]
ENCRYPT()

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents