I encrypted an image (png) by using AES (Encryption algorithm) and get encrypted NSData. I use FBEncryptor framework. Now I am trying to display it on UIImageView, but it does't work. Here is my code:
@interface ImageEncryptingViewController ()
@property (strong, nonatomic) IBOutlet UIImageView *encoptdImg;
@end
@implementation ImageEncryptingViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
UIImage *img = [UIImage imageNamed:@"image.png"];
NSData *imageData = UIImagePNGRepresentation(img);
NSData* encryptedData = [FBEncryptorAES encryptData:imageData key:imageData iv:imageData];
UIImage *image = [[UIImage alloc]initWithData:encryptedData];
NSLog(@"%@", encryptedData);
_encoptdImg.image = image;
}
In the end I want to get encrypted image, where we can see noise or something else, but not original image. For example this website do it. I need it on ios by using AES encryption algorithm. How I can solve this problem? Any ideas? Thanks.