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

Encryption in 1.1, Decryption in 2.0

Could anyone provide and example/link to how I could encrypt data in 1.1 and
decrypt in 2.0? I think I need to use 3DES
Aug 29 '07 #1
3 1936
On Aug 29, 1:50 pm, "Frank" <fkaes...@pfmail.comwrote:
Could anyone provide and example/link to how I could encrypt data in 1.1 and
decrypt in 2.0? I think I need to use 3DES
You should be able to use the same code you would have used to decrypt
in 1.1. If you're running into issues, please give more details.

Jon

Aug 29 '07 #2
Hello, Frank!

3DES is one of cryptographic algorithms. .NET has a set of them.

More details on how to encrypt/decrypt data you can find here -
http://www.codeproject.com/csharp/us...yptostream.asp

--

With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Wed, 29 Aug 2007 07:50:33 -0500:

FCould anyone provide and example/link to how I could encrypt data in
F1.1 and decrypt in 2.0? I think I need to use 3DES

Aug 29 '07 #3
Frank wrote:
Could anyone provide and example/link to how I could encrypt data in 1.1 and
decrypt in 2.0? I think I need to use 3DES
A simple 3DES example is attached below. It should work in both 1.1
and 2.0.

Arne

==========================

using System;
using System.Text;
using System.Security.Cryptography;

class MainClass
{
public static void Main(string[] args)
{
Encoding utf = new UTF8Encoding();
TripleDES des3 = new TripleDESCryptoServiceProvider();
byte[] key = utf.GetBytes("hemmeligabcdefgh12345678");
byte[] iv = { 1, 2, 3, 4, 5, 6, 7, 8 };
ICryptoTransform encrypt = des3.CreateEncryptor(key, iv);
String plain1 = "Dette er en lille test";
byte[] cipher =
encrypt.TransformFinalBlock(utf.GetBytes(plain1), 0,
utf.GetByteCount(plain1));
for(int i = 0; i < cipher.Length; i++)
{
Console.WriteLine(cipher[i]);
}
ICryptoTransform decrypt = des3.CreateDecryptor(key, iv);
String plain2 =
utf.GetString(decrypt.TransformFinalBlock(cipher, 0, cipher.Length));
Console.WriteLine(plain2);
}
}
Sep 3 '07 #4

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

Similar topics

1
by: D. Alvarado | last post by:
On my Fedora Core 2 Linux dev box, I have installed mcrypt and compiled PHP with the --with-mcrypt option. I am concerned that when I move to another hosting enviornment mcrypt will not be...
1
by: Jase H | last post by:
Hello, I have a ASP.NET web application problem involving the data encryption and decryption assembly(DLL) used on the connection string value that is set in the webconfig file. The problem...
2
by: Dave Bailey | last post by:
I have developed a web app using DPAPI to encrypt a connection string in the web.config file. The application works perfectly on the development machine but when deployed to the server when...
2
by: sushant.bhatia | last post by:
Hi All. I'm using the NCrypto dll for RSA Encryption/Decryption (http://sourceforge.net/projects/ncrypto/). My encryption code in .Net is pretty simple. The dataToEncrypt length is 1024. The...
2
by: almurph | last post by:
Hi everyone, Can you help me please? I am having a problem with the encryption/decryption of words with the Irish fada in them. The Irish fada is like this: áéíóú/ÁÉÍÓÚ. It's kind of like the...
4
by: Fritjolf | last post by:
Hi. I've got a strange problem... I've made a simple program to test encryption/decryption. I use Rijndael encryption and here are the most important properties. RijndaelManaged cipher =...
3
by: =?Utf-8?B?TG9yZW4=?= | last post by:
I’m trying to encrypt and decrypt a file in vb.net. I am using the TripleDESCryptoServiceProvider encryption found in System.Security.Cryptography. Below is the code for my Encrypt and Decrypt...
5
by: Netwatcher | last post by:
well, i started messing around with dictionaries, yet, most of the pages i found about them always talk about getting only one word out of it and turning it vice versa, i've been playing with that...
9
by: Betikci Boris | last post by:
I get bored last night and wrote a script that uses xor for encrypt- decrypt, however it woks fine under linux 2.6.25, text and documents are ok, but fails on compressed files *.jpg, *.pdf , etc ....
9
by: Alan M Dunsmuir | last post by:
In my (PHP-5) application I have to write some records to a table in my database, which I don't want even my clients using the system to be able to read. This is not a problem in National...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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,...

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.