473,516 Members | 3,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

equivalent of mysql aes_decrypt in php?

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 text , but I
cant figure out how to decrypt the hex to plaintext using php? I have
tried this without success, as AES is not recognized.

$input = 'some encrypted data in hexadecimal';

$len = strlen ( $input );
$input = pack("H" . $len, $input );

$td = mcrypt_module_open( 'AES' , '', 'ecb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND );
mcrypt_generic_init($td, $key, $iv);

$decrypted = mdecrypt_generic($td, $input );

Jul 22 '06 #1
0 1786

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

Similar topics

1
9430
by: Bruce | last post by:
I have an application where I would like to be able to allow the user to specify the date format used throughout the program (for internationalization). Then, on a date entry field, I can specify the date format on a MySQL SELECT to get the date in the proper format. The Javascript date selector I am using allows me to specify the format...
1
5587
by: JBBHF | last post by:
Hi i'm working on a web project, and i would like to make my oracle query work in mysql. select match.numero "nummatch", to_char(match.datematch, 'yyyy-MM-dd') "datematch", p1.numjoueur "j1", p2.numjoueur "j2", po1.p1 "m1p1", po1.p2 "m1p2", po2.p1 "m2p1",
7
2638
by: - | last post by:
in oracle there is a '%TYPE' to reference the data type of another column. is there an equivalent in mysql? thank you.
2
2226
by: Gnurp Gnarp | last post by:
How do I prevent the MySQL client to scroll pages when the results of a query exceeds the number of lines in the terminal window? Like a MySQL equivalent to *nix 'more'. mysql> select foo from bar; 2500 rows in set (0.00 sec)
2
1677
by: Murphy | last post by:
I am new to Linux and am migrating a SQL Server DB with an Access front end to MySQL and ? What options are available under Linux for development of a client front end without copious amounts of programming. Without knowledge of PHP can a front end be developed using plugin components with minimal fuss ?
2
9282
by: jblankenburg | last post by:
Please help! I am hunting high and low for an equivalent function for MSSQL's DATENAME function. Here's the spec on the function from MSSQL's Books Online: DATENAME Returns a character string representing the specified datepart of the specified date.
0
1927
by: Marcus | last post by:
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. ...
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' ), AES_DECRYPT( column3_etc... , 'mykey' ) This would make my code rather long . Is there a shortcut I am missing?
1
4145
by: nmailey | last post by:
Hi all. I'm having to convert a database over from MySQL to MSSQL 2000. The problem I'm encountering is that there's a password field that is using ENCODE and DECODE to set and retreive the password, and I'm unable to find an equivalent to this in MSSQL. So, my question is: Is there an equivalent to ENCODE/DECODE in MSSQL or is there a...
0
7273
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7405
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7136
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7547
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5106
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4769
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3252
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1620
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 we have to send another system
0
487
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.