473,394 Members | 1,726 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.

128bit decryption question?

J.R
The below code works if "Input" is the result of a read from a binary file.
I want Input to be a literal string variable. When this is the case,
received "Length of Data to Decrypt is Invalid" error.

Any ideas appreciated.

Thank you, John.

arrResult = UTF8.GetBytes(Input);

MemoryStream stmDecrypted = new MemoryStream();

cptTransform = tDesProvider.CreateDecryptor(arrKeyBytes, arrIVBytes);

CryptoStream stmCrypt = new CryptoStream(stmDecrypted, cptTransform,
CryptoStreamMode.Write);

stmCrypt.Write(arrResult, 0, arrResult.Length);

stmCrypt.FlushFinalBlock();
stmDecrypted.Position = 0;
stmDecrypted.Read(arrResult, 0, Convert.ToInt32(stmDecrypted.Length));

Output = UTF8.GetString(arrResult);
Nov 15 '05 #1
1 1338
J.R <so*****@somewhere.com> wrote:
The below code works if "Input" is the result of a read from a binary file.
I want Input to be a literal string variable. When this is the case,
received "Length of Data to Decrypt is Invalid" error.


Please post a short but complete program which demonstrates the
problem. See
http://www.pobox.com/~skeet/csharp/complete.html for what I mean by
that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2

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...
1
by: Martin | last post by:
Hi Im trying to make a Client/Server where im going to encrypt the stream but i cant get it to work. I can recieve and send as long as im not trying to send/recieve encrypted. but when i am i cant...
8
by: den 2005 | last post by:
Hi everybody, I am not sure where to put this in this forum. So, I posted this at several topics. I created a class library that has two public methods Encrypt() and Decrypt(). I reference this...
9
by: DarkProtoman | last post by:
How would I write a function to calculate RSA Decryption key. I'm trying to write an RSA encryption program, and I'm stuck on calculating the decryption key. How do you check for coprimality?...
1
by: BigLuzer | last post by:
hi i am using the following setup: - .net 1.1 - 2 load-balanced iis servers - DPAPI machine store. - C# - i encrypted the connection string separately, one on each machine. the error i get...
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...
13
by: Tom Andrecht | last post by:
I'm trying to get some encryption/decryption routines going to take care of my data, and while the encryption is working great, I keep running into the message "Padding is invalid and cannot be...
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 ....
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.