?
Solved

3des decryptor on PHP

Posted on 2009-05-04
3
Medium Priority
?
1,645 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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 …
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

839 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