Solved

3des decryptor on PHP

Posted on 2009-05-04
3
1,588 Views
Last Modified: 2013-12-13
Can some one tell me how can i make Triple Des Decryptor script?
0
Comment
Question by:Maranellas
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
Chad Smith earned 500 total points
ID: 24297211
$key = "This is a very secret key";
$iv_size = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
                  
$decoded = trim(mcrypt_decrypt(MCRYPT_3DES, $key, $encodedstring, MCRYPT_MODE_ECB, $iv));
0
 

Author Comment

by:Maranellas
ID: 24303842
Fatal error: Call to undefined function mcrypt_get_iv_size() in C:\WINDOWS\AppPatch\AppServ\www\3des.php on line 3
0
 

Author Comment

by:Maranellas
ID: 24303885
first problem solved

but i get another problem

Warning: mcrypt_decrypt() [function.mcrypt-decrypt]: Size of key is too large for this algorithm in /home/tuapuest/public_html/tmp/3des.php on line 6

the actual string is "6561535437506C766655576B6938734A4A68587448413D3D"

which corresponds to 192 bit string
<?

$key = $_GET['key'];

$iv_size = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_ECB);

$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);

                  

$decoded = trim(mcrypt_decrypt(MCRYPT_3DES, $key, $encodedstring, MCRYPT_MODE_ECB, $iv)); 

?>

Open in new window

0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now