-
May 9th, 2005, 08:00 AM
#1
Triple DES Encryption
Following code decrypts the encrypted string "thisDecode" but gives an error:
(Unhandled Exception: System.Security.Cryptography.CryptographicException: Bad Data.
at System.Security.Cryptography.CryptoAPITransform._DecryptData(IntPtr hKey,
Byte[] rgb, Int32 ib, Int32 cb, Boolean fDone)
at System.Security.Cryptography.CryptoAPITransform.TransformFinalBlock(Byte[]
inputBuffer, Int32 inputOffset, Int32 inputCount))
Code:
TripleDESCryptoServiceProvider* des;
des = new TripleDESCryptoServiceProvider();
des->GenerateKey();
des->GenerateIV();
ICryptoTransform *Decryptor;
Decryptor = des ->CreateDecryptor();
ASCIIEncoding* ascii2 = new ASCIIEncoding();
Byte DCode[] = Convert::FromBase64String(thisDecode);
String* decrypted;
decrypted = ascii2->ASCII->GetString(Decryptor->TransformFinalBlock(DCode, 0, DCode->Length),0,DCode->Length);
return decrypted;
Help needed regarding this.
Thanks.
-
May 24th, 2005, 09:13 AM
#2
Re: Triple DES Encryption
any one here knows Triple DES Decryption
-
June 26th, 2005, 01:33 AM
#3
Re: Triple DES Encryption
Sorry for the Delay in response.
The long and the short is YES.
In fact I have a report i could lend you on the encryption method and some source code if you need it. It's in C++.
Bill
I'm not sure about what your code is referring to, or what it means. Basically I just finished making my program to encrypt and decrypt a file. The program isn't complete, but it works, and it demonstrates the process. If you're trying to use a program that was already created I wish you luck. The DES algorithm isn't all that difficult if you have someone who is capable of explaining it to you, but otherwise it can be a bit annoying. I do recommend that you write your own program though for the simple fact that if you write your own program, well then you know how that works.
I put some source code on my site in case you still need some help. It was written on MS Visual C++ 6.0
http://tex23bm.mikee385.com/
Last edited by tex23bm; June 29th, 2005 at 11:38 PM.
-
July 17th, 2005, 04:49 AM
#4
Re: Triple DES Encryption
Thanks for your reply, but i got a solution for my problem. Actually i am working in .net, and using its inbuilt libraries of cryptography. This is much easier to work on, instead of working on VC6. It just requires few lines of code to implement DES/Triple DES, in comparison with VC6.
If you are interested in code of Triple DES implemented in C#, i can provide you that.
-
February 7th, 2013, 05:25 AM
#5
Re: Triple DES Encryption
hi I need a code of triple des in c++ for encryption and decryption can any one help me plz. thanx
-
February 7th, 2013, 05:45 AM
#6
Re: Triple DES Encryption
the site you put didn't open.
-
February 7th, 2013, 09:32 AM
#7
Re: Triple DES Encryption
Originally Posted by memo jar
the site you put didn't open.
No big surprise I'd say: The post is almost eight years old.
I can't give you an implementation of 3DES either, but the Wikipedia article may take you somewhat further. It refers to the article on DES, which describes the algorithm in detail so you may be able to implement it. The fourth external link from the article page seems to more specifically describe a concrete implementation and may even contain source code; I didn't take the effort to download and inspect the PostScript file, though. Once you've got the DES part working, it shouldn't be too difficult to implement 3DES based on that and the information from the first article I linked to.
HTH
Last edited by Eri523; February 8th, 2013 at 07:34 PM.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
February 8th, 2013, 04:31 PM
#8
Re: Triple DES Encryption
plz the fourth external link from the article page did not open. in which program i must open it
-
February 8th, 2013, 07:40 PM
#9
Re: Triple DES Encryption
Ghostscript should be able to open it.
Alternatively, a Google search for "Open PostScript file" may yield some useful results.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|