3des decryptor on PHP

Posted on 2009-05-04
Last Modified: 2013-12-13
Can some one tell me how can i make Triple Des Decryptor script?
Question by:Maranellas
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 10

Accepted Solution

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));

Author Comment

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

Author Comment

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


Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP query / monitor data from Telnet to MySQL 8 97
DNS CNAME records visibility on a web server 2 42
Length of for loop to be dynamic 2 33
Make login page safer 3 34
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

726 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