Solved

3des decryptor on PHP

Posted on 2009-05-04
3
1,593 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
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 …

803 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