Code Monkey home page Code Monkey logo

photo-with-secret's Introduction

Photo-With-Secret

An iOS app that can hide a text message inside a photo. The changes made to photo is so subtle that your eyes cannot distinguish the encrypted photo from the original one.

It also tries out the blur effect and interpolation effect on UIVIew supported on iOS 7.

Requirements

iOS 7.

Usage

Open with Xcode, run the app.

Hide a message

Reveal a message

Implementation Details

First, it converts the message into Brainfuck language using my handy NSString+Brainfuck category. This language only has 8 characters (+ - > < . , [ ]).

Next, it converts the image into a bitmap (resize it first if necessary). For every pixel in the bitmap, there are 4 channels (R, G, B, Alpha). It will choose some pixels to store your secret message represented in Brainfuck. Since there are only 8 characters in the converted message, they can be represented in binary (000, 001, 010, 011, 100, 101, 110, 111). I change the value of RGB channels of one pixel by 0 or 1 respectively, letting the values mod 2 of these three channels be the exact binary code (e.g. if I need to convert '>', its binary code may be 010, that pixel's R value mod 2 will be 0, G value mod 2 will be 1, B value mod 2 will be 0), so that a pixel can store a Brainfuck character without changing too much to be distinguishable from original pixel.

Note

Do not resize the output image, or you will probably (>99%) lose your hidden message in it!

photo-with-secret's People

Contributors

djben avatar

Watchers

James Cloos avatar ed1son avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.