SecretCipher - Secret Messages/Concealed Passwords within a string

Post your working scripts, libraries and tools
Posts: 1
Joined: 28 Feb 2018, 16:10

SecretCipher - Secret Messages/Concealed Passwords within a string

02 Mar 2018, 15:35

Thought it was an interesting concept for secret messages, or for my original purpose allowing you to use strong passwords without technically having to remember said password. It's kind of simple(ish) once you understand how the special keys work, depending on which version you use Simple or Complex both have different options, see below for a better description. Anyways the way it works is you input a text string and then you input some numbers and it will retrieve whatever character is at the numbers position within the text string. The idea is that a supposed attacker probably isn't going to know what/where you are getting your string from let alone its starting and ending position, or if you're even using one string you could combine strings from multiple sources.

Simple: Outputs as is, the only extra option available is for adding a space to your calculated string, no options for changing between uppercase and lowercase or adding a literal number or symbol, the only way to get a number or symbol in the calculated result is if it's in your Input Text String.

Complex: Output with options, has options for adding a space, changing between uppercase and lowercase, adding literal numbers and symbols to the output, convert numbers to symbols or vice-versa from the Input Text String.

Special Characters (These characters can easily be changed in the script)
SpaceKey = xx (Both versions, Used if you want to output an actual space)
NumberSplitKey = A_SPACE (Both versions, Separates your single number input string into multiple individual number strings)
EscapeKey = / (Complex Only, Used if you want to output a number or symbol)
LowercaseKey = _ (Complex Only, Used if you want to output the character as lowercase)
UppercaseKey = - (Complex Only, Used if you want to output the character as uppercase)
NoOutputKey1 = (Both versions, One of three characters that can be used to override the output, outputs nothing for that number if the character(s) are found somewhere beside it. Disabled when no character is assigned)
NoOutputKey2 =
NoOutputKey3 =

Now I am no expert programmer, noobish with AHK, So I can guarantee you my code is not the most efficient way to do what I want it to do, I'm sure it's quite messy looking, but what I have works. If someone wants to clean up my code, improve upon it, or add new features or whatever then by all means go right ahead.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

It's hard to describe how it all works, So I feel it's better to just show a lot of examples.

Example 1:

Input Text String: abcdefghijklmnopqrstuvwxyz

Number Keys and their Outputs:
Simple Version:

8 5 12 12 15 xx 23 15 18 12 4 = hello world

Complex Version:

_1 = a

-1 = A

-/1 = !
Literal Symbol

_/1 = 1
Literal Number

-8 _5 _12 _12 _15 xx -23 _15 _18 _12 _4 -/1 = Hello World!

Example 2:

Input Text String: This is a test! 123 (Note: All spaces get removed from the input text string so if you are manually counting to figure out what numbers to use make sure to skip over the spaces)

Number Keys and their Outputs:
Simple Version:

2 4 4 1 12 14 3 = hssT!2i

aw-#rb2fg 4@vx sgfs%b 4sfse* 1sdfv <12> 14 3 = hssT!2i

2 4 4 xx 1 12 14 3 = hss T!2i
xx is the character I assigned by default if you want to use a space

Complex Version:

-2 -4 _4 _1 -12 -14 -3 = HSst!@I

-2 -4 xx _4 _1 -1xx2 -14 -3 = HS st @I
The space character overrides everything no matter where you put it, with the exception of NoOutputKey 1-3 which truly overrides everything including the space character

-/4 _/4 -5 -/1 -/2 _15 -15 _0 -0 = $4I!@3#3#
Zero will output the last character in your string

ads-fwk/4a argw sdf_/adg4rox s-adew5///--_ -/1 -/2 _15 ---___-15 _0 -0 = $4I!@3#3#
You can kind of go crazy with it and make it look like a whole lot of nothing, more so if you change the "Split" character from a space to something else and make it look like one big garbled string, maybe that's what you are going for.

_1 _2 _999 _4 _0 -0 = ths3#
Any number higher than the length of your string won't have an output unless used literally with the escape character

/_/3 = No Output, If the escape character is the first character. With one exception, if the space character is included somewhere as seen below.

_/3 /_2 /_xx2 _/4 = 3 4
The one exception whenever the escape is the first character

asd@s%dfg/_/3 = No Output, The escape character is still the first character, my code will remove all letters and symbols that aren't either the Escape, Uppercase, or Lowercase character and detect the escape character as being first

_/999 -/922 -/0 _/0 = 999)0
-/922 has no output because it is outside the bounds of my special character array (symbols) there is a total of 32 characters currently, so anything between -/0 and -/31 is accepted and anything higher will have no output. Unless of course you add/remove characters from that array, my code is set up to handle that. Though you shouldn't change the first 10 characters I set it up to match the symbols tied to the number keys on the keyboard and if changed the conversion from number to symbol and vice-versa from your input text string won't work as intended.

-12 _12 -13 _14 -14 = !1!2@
Example showing the conversion symbols to numbers and numbers to symbols

-__--_2 __-_2 -1/0 5_ = HhS
My code will use the first uppercase or lowercase character it encounters and remove all others if there is multiple, escape key is handled the same way. The exception being that if the first uppercase, lowercase, or escape character it encounters is behind the first number encountered
User avatar
Posts: 455
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: SecretCipher - Secret Messages/Concealed Passwords within a string

06 Mar 2018, 08:16

Hello Xion.

Welcome to the AutoHotkey Community forums.

This is an interesting tool. Good passwords are both hard to guess (by any third-party) and easy to remember (by yourself). If one can input two easy to remeber strings (one literal, one numeric) and use the code above, he/she should retrieve a hard to guess output.

I had some trouble using it at first though. I set my literal string as "abcdefghi" and my numeric input as "888333". It both did not give me any results and did not output any error warnings. Took a while to figure out i had to input the numbers as "8 8 8 3 3 3" based on the examples. I suppose some error warnings for cases like this would be a good addition to guide new users into correct usage.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Thanks for sharing.
"What is suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 23 guests