TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Aug 2015 |
Maintained by Isaac Stevao Sena.
ISStego is an Objective-C library for Mac OS X & iOS that can be used to encode and decode secret data with images using digital techniques of steganography, a form of security through obscurity.
Steganography comes from the Greek words steganos, meaning covered or protected, and graphein, meaning writing. Basically it is the practice of hiding important information within a unimportant object. For instance we can hide a message within another message, image, audio or video.
See example:
original Image | Stego image |
---|---|
Pure image (without hidden information) | Image with a steganographically hidden text (2198 characters). |
FALSE. They are completely different.
The main propose of encryption is to hide the meaning of the message by converting ordinary information (plaintext) into unintelligible text (ciphertext). You can detect if something has been encrypted.
On the other hand, steganography hides the information itself and most people would not detect its presence.
Steganography is a form of security but it is not unique. We can (and we recommend using) use other forms of security, such as encryption, in addition to steganography.
ISStego uses three steganography techniques:
Drag the ISStego folder into your project.
Import ISSteganographer
#import "ISSteganographer.h"
NSString *encryptedPassword = @"47151d0e56f8dc";
UIImage *image = [UIImage imageNamed:@"imageName"];
[ISSteganographer hideData:encryptedPassword
withImage:image
completionBlock:^(id image, NSError *error) {
if (error) {
NSLog(@"error: %@", error);
} else {
[UIImagePNGRepresentation(image) writeToFile:@"PATH_OF_FILE"
atomically:YES];
}
}];
UIImage *image = [UIImage imageNamed:@"stegoImageName"];
[ISSteganographer dataFromImage:image
completionBlock:^(NSData *data, NSError *error) {
if (error) {
NSLog(@"error: %@", error);
} else {
NSString *hiddenData = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
NSLog(@"string: %@", hiddenData);
}
}];
NSString *encryptedPassword = @"47151d0e56f8dc";
NSImage *image = [NSImage imageNamed:@"imageName"];
[ISSteganographer hideData:encryptedPassword
withImage:image
completionBlock:^(id image, NSError *error) {
if (error) {
NSLog(@"error: %@", error);
} else {
CGImageRef cgRef = [image CGImageForProposedRect:NULL
context:nil
hints:nil];
NSBitmapImageRep *bitmapImage = [[NSBitmapImageRep alloc] initWithCGImage:cgRef];
[bitmapImage setSize:[image size]];
NSData *pngData = [bitmapImage representationUsingType:NSPNGFileType
properties:nil];
[pngData writeToFile:@"PATH_OF_FILE"
atomically:YES];
bitmapImage = nil;
}
}];
NSImage *image = [NSImage imageNamed:@"stegoImageName"];
[ISSteganographer dataFromImage:image
completionBlock:^(NSData *data, NSError *error) {
if (error) {
NSLog(@"error: %@", error);
} else {
NSString *hiddenData = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
NSLog(@"string: %@", hiddenData);
}
}];
Isaac Stevao Sena, @IsaacStevaoSena
ISStego is released under the MIT license. See LICENSE.md.