locked
AES encryption using c# RRS feed

  • Question

  • hi everyone. Recently i get my final year thesis which is encryption for instant messenger.
    And after doing some research on my topic, i decide to implement AES algorithm using C#. i would like to knw whether we can encrypt image using AES and is there any useful website or source code that can help me?And is there anybody can give me suggestion on what other thing that i can make improvement on AES algorithm or the application for AES in instant messenger? hope to get reply from u all as soon as possible.

    thanks ya Smile


    Monday, October 13, 2008 5:24 PM

Answers

  • The encryption algorithms available in the .Net framework don't care what type of information you are encrypting.  the only constraint is that the information must be passed to the encryption algorithm as a byte stream.   Anything that I can represent as a byte stream (images,  numbers, or my grandmother's secret recipe for cookies) is encryptable.  It is up to you to convert your data to and from a byte stream.  You may want to look into binary serialization for this.

     

    As for a code example look no further than the MSDN documentation for the RijndaelManages class. Rijndael is another name for the AES encryption algorithm. 

     

    I am afraid I can give no suggestions on improving the algorithm.  Developing encryption algorithms is not a trivial tasks, so you are on your own there.

    Tuesday, October 14, 2008 2:30 AM

All replies

  • The encryption algorithms available in the .Net framework don't care what type of information you are encrypting.  the only constraint is that the information must be passed to the encryption algorithm as a byte stream.   Anything that I can represent as a byte stream (images,  numbers, or my grandmother's secret recipe for cookies) is encryptable.  It is up to you to convert your data to and from a byte stream.  You may want to look into binary serialization for this.

     

    As for a code example look no further than the MSDN documentation for the RijndaelManages class. Rijndael is another name for the AES encryption algorithm. 

     

    I am afraid I can give no suggestions on improving the algorithm.  Developing encryption algorithms is not a trivial tasks, so you are on your own there.

    Tuesday, October 14, 2008 2:30 AM
  • Hi, nice to meet u and thank you for providing me some information. erm..I not really sure about the byte stream. May i knw how can i change an images or file to byte stream? Any example? And is it possible to encrypt word file, excel file and even powerpoint file? Sorry for any inconvenience that i bring to sir.
    Anyway, thanks a lot.

    from,
    cat_sin
    Tuesday, October 14, 2008 6:58 AM
  • It's not hard.  If you know how to write something to a file then you can get it into a byte stream.  The Bitmap object already has a method for writing itself to a stream (file).  You can use a MemoryStream instead of a FileStream to capture the bytes and then use the memory stream to direct the bytes to your encryption object.

     

    Thursday, October 16, 2008 3:09 AM
  • Hi,

     

    I'm also developing an application which encrypts the files selected by the user and i'm planning to use AES. will the RijndaelManages class mention above work for window mobile 6.5?

    Sunday, March 6, 2011 4:21 AM