473,394 Members | 1,715 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,394 software developers and data experts.

How to decrypt DES using asp/c#/vb ?

Dear all,

How to decrypt DES using asp/c#/vb ? Please advise ..
Nov 16 '05 #1
5 6915
This FAQ will provide you with a starting point...
http://www.gotdotnet.com/team/clr/cryptofaq.htm

--- Nick

"Kelvin" <ke*******@gmail.com> wrote in message
news:db*************************@posting.google.co m...
Dear all,

How to decrypt DES using asp/c#/vb ? Please advise ..

Nov 16 '05 #2

Hi Nick,

Do you have sample or tutorial how to decrypt 3DES/DES using traditional
asp or C#/ASPX ?
Please advise.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3
Hello Tai:

Encryption:

TripleDES des3 = new TripleDESCryptoServiceProvider();
byte[] buff = ASCIIEncoding.ASCII.GetBytes(source.Text);
byte[] bytesKey = ASCIIEncoding.ASCII.GetBytes(encKey.Text);
des3.Mode = CipherMode.ECB;
if (encKey.Text.Length != 24)
{
outputStr = "Key size is illegal. Please supply a 192bit key (24
characters)";
}
else
{
des3.Key = bytesKey;
byte[] encrypted = des3.CreateEncryptor().TransformFinalBlock(buff, 0,
buff.Length);
outputStr = Convert.ToBase64String(encrypted);
}

Decryption:
TripleDES des3_dec = new TripleDESCryptoServiceProvider();
byte[] buff = ASCIIEncoding.ASCII.GetBytes(source.Text);
byte[] bytesKey = ASCIIEncoding.ASCII.GetBytes(encKey.Text); // Note that
the key is 192bit long
des3_dec.Mode = CipherMode.ECB;
.....
outputStr =
Convert.FromBase64String(des3_dec.CreateDecryptor( ).TransformFinalBlock(buff
, 0, buff.Length));

I gleaned this from a couple of other postings on the
microsoft.public.dotnet.security newsgroup.
I'm no expert on crypto, but some of the folks on that NG certainly are, and
may be able to help you further if this code isn't sufficient.

Hope this helps,
--- Nick

"Tai Kelvin" <ke*******@gmail.com> wrote in message
news:e8**************@TK2MSFTNGP11.phx.gbl...

Hi Nick,

Do you have sample or tutorial how to decrypt 3DES/DES using traditional
asp or C#/ASPX ?
Please advise.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #4
Hi Nick,

Thanks for your support first ! Do u have any sample to support
traditional asp code ?
Please advise !

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #5
not off the top of my head. Google for CAPICOM

--- Nick

"Tai Kelvin" <ke*******@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi Nick,

Thanks for your support first ! Do u have any sample to support
traditional asp code ?
Please advise !

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #6

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

Similar topics

4
by: Hrvoje Voda | last post by:
Does anyone knows a good example of how to encrypt/decrypt a string? Hrcko
6
by: Carolyn Vo | last post by:
Hi there! I have a string that was encrypted in Java using the classes DESKeySpec, SecretKeyFactory, SecretKey, and Cipher. It looks like using the SecretKeyFactory puts a transparent layer on...
8
by: Gidi | last post by:
Hi, Is there Buid-In fuction in C# that Encrypt and Decrypt strings? i have a textbox which i'm writing into file, and i want to encrypt it before writing, i'm not looking for something fancy,...
7
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm...
4
by: hohans | last post by:
Hi all, I have an encryption class that encrypts and decrypts password using TripleDESCryptoServiceProvider. It was written originally in framework 1.0 and been working fine. And those...
0
by: Hannibal111111 | last post by:
I found this code on a site for doing string encryption/decryption. The string will encrypt fine, but I get this error when I try to decrypt. Any idea why? I posted the code below. The error...
2
by: Bernard Dhooghe | last post by:
The information center writes: "Encryption Algorithm: The internal encryption algorithm used is RC2 block cipher with padding, the 128-bit secret key is derived from the password using a MD2...
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: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
2
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.