469,924 Members | 1,408 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,924 developers. It's quick & easy.

Weird thing with DES


I use the DES_ENCRYPT and DES_DECRYPT with the string 'sfG3853ncr1pt'
I can't seem to encrypt the number 227968199 because I tried several
times and also tried other numbers which work fine.

Here is a sample session:
mysqlcreate table `destest` (num varchar(17));
Query OK, 0 rows affected (0.04 sec)
mysqldesc destest;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| num | varchar(17) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
1 row in set (0.00 sec)
mysqlinsert into destest(num) values(DES_ENCRYPT('227968199',
'sfG3853ncr1pt'));
Query OK, 1 row affected (0.00 sec)
mysqlselect * from destest;
+------------------+
| num |
+------------------+
| Ԩ!?`f4~k |
+------------------+
1 row in set (0.00 sec)
mysqlselect DES_DECRYPT(num, 'sfG3853ncr1pt') from destest;
+-----------------------------------+
| DES_DECRYPT(num, 'sfG3853ncr1pt') |
+-----------------------------------+
| Ԩ!?`f4~k |
+-----------------------------------+
1 row in set (0.00 sec)
mysqlinsert into destest(num) values(DES_ENCRYPT('12345678',
'sfG3853ncr1pt'));
Query OK, 1 row affected (0.00 sec)
mysqlselect DES_DECRYPT(num, 'sfG3853ncr1pt') from destest;
+-----------------------------------+
| DES_DECRYPT(num, 'sfG3853ncr1pt') |
+-----------------------------------+
| Ԩ!?`f4~k |
| 12345678 |
+-----------------------------------+
2 rows in set (0.00 sec)
I have also tried

FLUSH DES_KEY_FILE;
It is so weird!
Reply

Aug 4 '06 #1
0 1997

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Gabriel Afana | last post: by
1 post views Thread by gukn9700 | last post: by
11 posts views Thread by Les Paul | last post: by
1 post views Thread by Ot | last post: by
13 posts views Thread by Krzysztof Bartosiewicz | last post: by
reply views Thread by Zwyatt | last post: by
5 posts views Thread by Peter Oliphant | last post: by
4 posts views Thread by d3vkit | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.