473,378 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to using 3DES with MD5 / CFB Mode to Encrypt/Decrypt code ?

Dear all,

I don't know how to write a asp/vb/c# program to decrypt PHP encrypted code.

Here is attched my code in PHP

$key = "ab";
$random_number = kelvin;
$encrypted=encrypt($key,$random_number);
$decrypted=decrypt($key,$encrypted);

echo "NUMBER: $random_number<br>
ENCRYPTED VALUE: $encrypted<br>
DECRYPTED VALUE: $decrypted";

/* Your functions without the comments are below */

function encrypt($key, $plain_text) {
$plain_text = trim($plain_text);
$iv = substr(md5($key), 0,mcrypt_get_iv_size (MCRYPT_CAST_256,MCRYPT_MODE_CFB));
$c_t = mcrypt_cfb (MCRYPT_CAST_256, $key, $plain_text, MCRYPT_ENCRYPT, $iv);
return trim(chop(base64_encode($c_t)));
}
Thanks
Nov 21 '05 #1
0 1719

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

Similar topics

1
by: wqhdebian | last post by:
As far as I know,when encrypt or decrypt ,a key must first be got,and the key is first generate by a tool or from SecurityRandom,that means I can not generate the same key with the same input.Does...
5
by: Kelvin | last post by:
Dear all, How to decrypt DES using asp/c#/vb ? Please advise ..
12
by: Charlie | last post by:
Hi: My host will not allow me use a trusted connection or make registry setting, so I'm stuck trying find a way to hide connection string which will be stored in web.config file. If I encrypt...
3
by: Kelvin | last post by:
Hi All, I don't know how to using DES CreateDecrytor to decode decrytion code from PHP ? for example, key: 11, decrytion code: 0kxMyjuiI8A Orignal : ryan Please advise.
5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
0
by: Sathyaish | last post by:
I am using CBC as the cipher mode to decrypt some text I'd encrypted using the same mode for 3DES algorithm. My decrypt does not return the correct result because the TransformBlock method returns...
3
by: tshad | last post by:
I am trying to use 3DES to encrypt my keys and am using VS 2003. I am trying to pass a value like: mCJ4@L2= where the value is 8 bytes long. I was told that you need a 16 byte key. But this...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
1
by: =?Utf-8?B?QnJpYW4gTmllbHNlbg==?= | last post by:
Hi I'm trying to use the Cryptography application block within a web application and have encountered a problem that I hope you can help resolve. 1. When I create a key file through...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.