472,103 Members | 1,067 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,103 software developers and data experts.

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 2041

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 Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.