I have chosen an algorithm to encrypt a file. i may encrypt text or image files. How can I write a generic type of encryption method that works with both text and image files? I’m working with Objective-C.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What ever you are encrypting you might be using the data or specifically NSData, then converting it to char array and then applying the algorithm. So make a method that takes NSData as an argument, and return encrypted NSData.
e.g.
Convert your
ImageorFileintoNSDataand pass it to the method.