473,508 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AES_ENCRYPT() / AES_DECRYPT() question

Hello,

I have been storing passwords in my database via AES_ENCRYPT and using
AES_DECRYPT if I need to retrieve them in readable form. For the most
part everything works fine, but I noticed that a few entries when
returned using AES_DECRYPT register as NULL.

The column in question is of type TINYBLOB, and has a NOT NULL
constraint. Passwords are all between 6 and 10 characters in length.
When I searched the net for similar problems, most other people reported
using some sort of TEXT type, and I am aware of the problem with TEXT
types and uneven padding, but I don't think that is my problem here
since I am using a TINYBLOB.

So here are my questions...

1) Is TINYBLOB too small for some reason, and should I instead use BLOB?
I would rather save disk space if possible using TINYBLOB especially
since the max an entry can be is 10 characters, and the great majority
of my rows are correct, but I haven't been able to rule out this as the
problem

2) How can these fields be NULL if I have a NOT NULL constraint, is it
because the DB is looking at the TINYBLOB object and treating that as
something that is NOT NULL?

3) If I do need to change the column type to BLOB, will my current
TINYBLOBs transfer fine via a simple alter table ... modify column ...
query or will there be some padding issues?

Thanks a bunch in advance for all your help.
Mar 14 '06 #1
0 1926

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5110
by: Gordan | last post by:
mysql> select aes_encrypt('gordan', 'abc'); +------------------------------+ | aes_encrypt('gordan', 'abc') | +------------------------------+ | p§Èb9??_é?0ö?LIÝ |...
3
4997
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
3
3058
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
53
4020
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
4695
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
1
10957
by: veg_all | last post by:
If all my columns are encrypted, is it true that I can not use a simple 'select * from' anymore. Instead I need to do: select AES_DECRYPT( column1 , 'mykey' ), AES_DECRYPT( column2 , 'mykey' ),...
0
1786
by: veg_all | last post by:
I am using AES_DECRYPT and AES_DECRYPT to store my datat in mysql databases. I want to be able to download these as csv files and have a php script decrypt them. I can use bin2hex to convert to...
2
4581
by: Paul | last post by:
I encrypted a database field using MySQL AES_ENCRYPT() from a mysql command prompt. But I need to encrypt and decrypt at will in the php code as records are added and viewed. I can easily...
0
1490
by: Paul | last post by:
I want to add a binary element (AES_ENCRYPT()) to a $_POST array. I need to make it binary because it is going into a BLOB field. $results = $dbr->Execute('select * from table1 where id='.$_GET);...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.