The Best Text Encryptor

Introduction(介紹)

Text Encryptor can encrypt all kind of language.
文字加密器可以加密任何語言

Principle(原理)

Encryption(加密)

  1. The text will be converted with the charset you select to Base64
//java-Android String result ; byte[] base64_byte; try { encodeValue = Base64.encode(message.getBytes(charset), Base64.DEFAULT); result = new String(base64_byte); //result is the output } catch (UnsupportedEncodingException e) { e.printStackTrace(); }
  1. Now,All of the text are converted to English characters.
  2. We use ASCII Code to convert characters to Integer.
  3. encrypt our data by XOR.
XOR Truth table(真值表)
A B F
0 0 0
0 1 1
1 0 1
1 1 0
//java-Android StringBuilder result = new StringBuilder(); //message is the output of Base64 //key char[] out = message.toCharArray(); int c; for (char anOut : out) { try { c = (int) anOut; } catch (IndexOutOfBoundsException e) { e.printStackTrace(); } c ^= key;//encrypt the character String Hex = Integer.toHexString(c); result.append(Hex).append(" "); } //result is the output
  1. Get the result as Hex

Decryption(解密)

  1. Decrypt the text of encryption with correct key.
//java-Android //key //message is the output of encryption StringBuilder result = new StringBuilder(); String[] ASCII = message.split("\\s+"); for (String integer : ASCII) { int b=0; try { b = Integer.parseInt(integer, 16); // Convert Hex to Decimal } catch (NumberFormatException e) { e.printStackTrace(); } char c = (char) (b ^ key); result.append(c); } //result is the output
  1. Now,we get the Base64 characters,convert the characters with charset you select to text.
//java-Android //message is the output of Base64 String result; byte[] base64_byte = Base64.decode(message, Base64.DEFAULT); try { result= new String(base64_byte, charset); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } //result is the output

How are you waiting for??

Get it on Google Play

Comments

Popular posts from this blog

"File Encryptor" logo design