0

I wanted to encrypt an image using RSA algorithm in matlab. I tried google, but I was not able to derive any help from the links obtained. Can someone help me where to start ? I am totally new to maltab. Thanks.

competesingh
  • 145
  • 2
  • 9
  • no its not a duplicate. I had seen that post before. I am asking for `image encryption` .. not a simple `message` encryption – competesingh Jul 15 '14 at 07:15
  • There certainly are examples for RSA in Matlab out there (e.g. [here](http://stackoverflow.com/questions/9436323/rsa-code-in-matlab/9436658#9436658)). Whether your data is an image or anything else is irrelevant for the encryption. Also, if you're completely new to a language, crypto is maybe not the best thing to start with... – mbschenkel Jul 15 '14 at 07:16
  • 1
    So how is that different then? Where are you stuck at? Also, if you are aware of similar questions, it would be advisible to include them in your question and point out the difference. – mbschenkel Jul 15 '14 at 07:17
  • do u have an example for image encryption ?? Can you write the code for image encryption ?? please help me by giving me relevant examples.. – competesingh Jul 15 '14 at 07:18
  • Serialize your image (You did not specify whether your image is a raw matrix or an file in e.g. JPEG, so hard to guess how to do that), then encrypt and decrypt as in the other post, then deserialize it again. Maybe you start with the middle part, by actually taking a simple message first. – mbschenkel Jul 15 '14 at 07:24
  • my image is a file .. how is serializing done ?? what does it mean ? – competesingh Jul 15 '14 at 07:26
  • 2
    @competesingh: Stack Overflow is not the place to ask to get code examples and/or walk-throughs for your task. At the very least, please show code you have so far, and explain in detail what *specific* problem you face for writing the next part. If you are not at the stage where that kind of question is possible (because you are tackling a complex task, and are a beginner), then you need to find a more open-ended place where the helpers have time to give you the more personal training and support that you need. – Neil Slater Jul 15 '14 at 07:51
  • @competesingh: For example, [Rossetta Code has an RSA example](http://rosettacode.org/wiki/RSA_code) and is a place where posters are encouraged to upload complete working examples for you to study. – Neil Slater Jul 15 '14 at 07:52
  • 2
    @competesingh Images, text, spreadsheets... these are all just bits and the method to encrypt them doesn't vary by what the bits represent. – Thomas M. DuBuisson Jul 15 '14 at 15:25
  • RSA is for messages (*typically ASCII strings with chracters 0-127*) and not for images. So you've to **custom encode image object into array of ascii strings** and then do RSA encryption on message. After receiving and de-crypting the message you've to convert received string back to image. In line with [Thomas M DuBuission](http://stackoverflow.com/users/216164/thomas-m-dubuisson)'s comment. – SACn Mar 05 '17 at 09:08

0 Answers0