Apollo18.Cipher (Apollo18 v1.0.1)

Provides cipher mechanism to make your things be like Apollo 18: Officially don't exists, only the owner know that it (if ?) exists.

The truth is out there (Maybe ...).

Link to this section Summary

Functions

Cipher a text/string object. Each time that a same string is ciphered, the cipher will be another cipher. However when decipher all then will result in same origin string.

Decipher a previously ciphered string that contains a text/string object.

Link to this section Functions

Link to this function

cipher(string, salt \\ 1, key \\ 0)

Cipher a text/string object. Each time that a same string is ciphered, the cipher will be another cipher. However when decipher all then will result in same origin string.

The salt parameter can be used to make more strong the cipher. Increase of processing time is also proportional to this value. By default the minimum value is equal to 1.

Only supported chars will be ciphered. All non supported chars will be removed from original text/string before of cipher process. This could generate some decipher "issues".

Supported chars

  [
    "A","Ä","Ã","Â","Á","À","Æ","А",
    "B","Б","Ъ","Ь","Ы","C","Ç","D","Ð","Д","В","С",
    "E","Ë","Ẽ","Ê","É","È","Э","Е",
    "F","Ф","G","Г","H","Н",
    "I","Ï","Ĩ","Î","Í","Ì",
    "J","Ж","K","К","L","Л",
    "M","М","N","Ñ","И","Й",
    "O","Ö","Õ","Ô","Ó","Ò","Ѳ","О",
    "P","Р","П","Q","R","S","Ш","Щ","T","Т","Þ","Ц","Ч",
    "U","Ü","Ũ","Û","Ú","Ù",
    "V","X","Х","W",
    "Y","Ÿ","Ỹ","Ŷ","Ý","Ỳ","У",
    "Z","З",
    "ẞ","Ю","Я",
    "a","ä","ã","â","á","à","æ","а",
    "b","б","ъ","ь","ы","c","ç","d","ð","д","в","с",
    "e","ë","ẽ","ê","é","è","ə","œ","ɛ","э","е",
    "f","ф","g","г","h","н",
    "i","ï","ĩ","î","í","ì",
    "j","ж","k","к","l","л",
    "m","м","n","ñ","и","й",
    "o","ö","õ","ô","ó","ò","ѳ","о",
    "p","р","п","q","r","s","ш","щ","t","т","þ","ц","ч",
    "u","ü","ũ","û","ú","ù",
    "v","x","х","w",
    "y","ÿ","ỹ","ŷ","ý","ỳ","у",
    "z","з",
    "ß","ю","я",
    "ʃ","ʒ","ʁ","ɾ",
    "Ѣ","ѣ","Ѵ","ѵ",
    "0","1","2","3","4","5","6","7","8","9",
    " ",".",",",";",":","<",">","/","\","?","|",
    "[","]","{","}","(",")","º","°","ª",
    "+","-","=","_","*","&","%","$","#","@",
    "~","^","´","`","‘","’","“","”",
    "!","'",""","\n","\r","\t","\b","\f"
  ]

Examples

iex > Apollo18.Cipher.cipher("mytext")
"789C4111413031FF412031DFD115D167D176D143D137D176"
iex > Apollo18.Cipher.cipher("mytext")
"FFD8FFEE4129414031DF31DF31FF021402660275024202360275"
iex > Apollo18.Cipher.cipher("mytext")
"1F8B411131EF4110415031CFA0EAA03DA04CA019A00DA04C"
iex > Apollo18.Cipher.cipher("mytext",2)
"CAFEBABE41594120410041004100918F9193918F918491CF91DF91B
F91B391BF9193917F915F919F916F916F916F919F916F919F915F919
F916F915F915F918F916F91939184919F916F91AF915F916F917F91E
F91BF916F917F910491DF916F917F918491CF916F917F9193919F916
F917F914391DF916F917F918491CF"
iex > Apollo18.Cipher.cipher("mytext",3)
"504B0506313F4130413031DF4150E143E172E134E1B3E1F2E172E1F2
E1B3E14FE11FE10FE11FE14FE11FE14FE10FE13FE11FE163E134E14FE
11FE10FE10FE14FE11FE11FE10FE10FE12FE11FE172E10FE12FE11FE1
72E10FE12FE1B3E19FE134E11FE163E1B3E10FE12FE1B3E19FE10FE12
FE10FE172E10FE12FE1B3E19FE10FE12FE10FE172E10FE12FE163E19F
E10FE12FE1F2E19FE134E11FE1B3E163E134E11FE163E1B3E10FE12FE
1B3E19FE10FE12FE1F2E19FE10FE12FE172E19FE10FE12FE172E19FE1
0FE12FE163E19FE10FE12FE1F2E19FE134E11FE163E1B3E134E11FE16
3E1B3E10FE12FE163E19FE10FE12FE1F2E19FE134E11FE10FE1B3E134
E11FE163E1B3E10FE12FE143E19FE10FE12FE172E19FE134E11FE163E
1B3E10FE12FE163E19FE10FE12FE143E19FE10FE12FE172E19FE10FE1
2FE1B3E19FE10FE12FE10FE172E10FE12FE143E19FE10FE12FE172E19
FE10FE12FE134E19FE10FE12FE134E19FE10FE12FE143E19FE10FE12F
E172E19FE10FE12FE143E19FE10FE12FE143E19FE10FE12FE143E19FE
10FE12FE172E19FE10FE12FE1F2E19FE10FE12FE10FE172E10FE12FE1
43E19FE10FE12FE172E19FE10FE12FE134E19FE10FE12FE134E19F"
Link to this function

decipher(string, salt \\ 1, key \\ 0)

Decipher a previously ciphered string that contains a text/string object.

Should be used the same salt and key values used in call to cipher function.

Examples

iex > Apollo18.Cipher.decipher("78DA313F41504100413031EF5209525B526A5237522B526A")
"mytext"
iex > Apollo18.Cipher.decipher("00000100313F4130415041304120F18BF1DDF1ECF1B9F1ADF1EC")
"mytext"
iex > Apollo18.Cipher.decipher("D0CF11E0A1B11AE14129415031FF31FF4100526052B252C1429E528252C1")
"mytext"