TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Samuel Amantea Collins
NA
10
0
Rijndael image encryption problem
Apr 1 2011 9:08 PM
Hi i have a problem with Rijndael encryption (I've uploaded the source code). Basically i'm trying to convert an image into byte[] data, run Rijndael encryption on it based on a given password. Then i need to be able to convert that Byte[] data back into a bmp. This is where the problem seems to occur. The line:
tempImage = Image.FromStream(ms, true);
always throws the exception "invalid paramater" meaning that it can't read the byte[] data and convert it into a bmp image. If i take out the Rijndael encryption, there is no problem but for some reason, when i do use it, it seems to give me back an invalid byte[] representation for a bmp?! I've been trying to work out what's going on here for a while and it's getting really frustrating. I'd appreciate any help that can be given.
Also, you may notice that i've used a message box to show me information about the byte data before and after encryption. I did notice that the byte[] data afterwards was 10 larger than before encryption. I don't know why or what this means but it seems to occur first at the line:
byte[] encryptedData = ms2.ToArray();
Thanks in advance :)
Reply
Answers (
3
)
Algorithms optimization and tracing
how to implementation buddy system memory allocator? (solved)