=========== Noob Cypher =========== by alcopaul/brigada ocho october 19, 2011 This article will describe a theoretical encryption algorithm that you may choose to implement. So I've been thinking about something that is related to cryptography. I was wondering how can one hide information in a given information. Say I have a paragraph, I was thinking of a way of using that paragraph to conceal any information that I want. So after some thinking, I arrived to an idea and this article will attempt to describe it. Say we have a text Paragraph which I'll call Reference Matrix ============================================ the quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG. There are 298.298.398 stars that I can see.= ============================================ And I want to use that text to hide this data Data ================ alcopaul is cool ================ I can straightforwardly encrypt Data using a symmetric cypher. But I want Reference Matrix to have a relationship to Data such that I can present the final encrypted text as Encrypted Text ================================================ the quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG. There are 298.298.398 stars that I can see.= [whatever text here which is the encrypted data] ================================================ And if presented as this, a user who doesn't know that the above text has embedded data in it may dismiss the appended text as gibberish and only notice the readable text. So how can I relate the Reference Matrix to Data such that I can arrive to Encrypted Text? First thing that we can do is to base64 encode Data Data ================ alcopaul is cool ================ to ======================== YWxjb3BhdWwgaXMgY29vbA== ======================== Now we have the base64 encoded Data, we can now use the Reference Matrix to encode again the base64 string First we could just take the position of each of the letters in the Reference Matrix t = 1, h = 2, e = 3, q = 5, u = 6, i = 7, c = 8, k = 9, b = 11, r = 12, o = 13, w = 14, n = 15, f = 17, o = 18, x = 19, j = 21, u = 22, m = 23, p = 24, s = 25, o = 27, v = 28, e = 29, r = 30, t = 32, h = 33, e = 34, l = 36, a = 37, z = 38, y = 39, d = 41, o = 42 g = 43 . = 44, T = 47, H = 48, E = 49, Q = 51, U = 52, I = 53, C = 54, K = 55, B = 57, R = 58, O = 59, W = 60, N = 61, F = 63, O = 64, X = 65, J = 67, U = 68, M = 69, P = 70, S = 71, O = 73, V = 74, E = 75, R = 76, T = 78, H = 79, E = 80, L = 82, A = 83, Z = 84, Y = 85, D = 87, O = 88, G = 89, . = 90, T = 93, h = 94, e = 95, r = 96, e = 97, a = 99, r = 100, e = 101, 2 = 103, 9 = 104 , 8 = 105 , . = 106 , 2 = 107, 9 = 108, 8 = 109 , . = 110, 3 = 111, 9 = 112, 8 = 113, s = 115, t = 116 ,a = 117, r = 118, s = 119, t = 121, h = 122 ,a = 123, t = 124, I = 126, c = 128, a = 129, n = 130 , s = 132 , e = 133, e = 134, . = 135, '=' = 136 Use the matrix to encode the base64 code with the corresponding positions But first to deal with letters/symbols that have multiple occurences thus having multiple positions, we can do something like get the positions of, say letter "h" h = 2, 94, 122 then randomize the array and get the result and substitute it accordingly to the base64 encoded text so this ======================== YWxjb3BhdWwgaXMgY29vbA== ======================== after getting the positions of the letters/symbols, should become like this ===================================================================================================== [85][60][19][21][11][111][57][94][41][60][14][43][99][65][69][43][85][107][112][28][11][83][136][136] ===================================================================================================== And the final encrypted text would be presented like this Encrypted Text ================================================ the quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG. There are 298.298.398 stars that I can see.= [85][60][19][21][11][111][57][94][41][60][14][43] [99][65][69][43][85][107][112][28][11][83][136][136] ================================================ So you can pass that around and it looks innocent to the regular user. So this is what your encoder should do. 1.) Encode the data using base64. This ensures that only the letters of the alphabet and a few symbols are used. 2.) Read the reference matrix, a paragraph which contains all the letters of the alphabet, uppercase or lower case, numbers and few symbols. This can be small or very large. Record the occurences and the positions of each letter from the paragraph in a table. If multiple occurences exist for a letter, make a mini-array that has the positions. This array can later be used in the encoding process. 3.) Read each character of the base64ed data. For each character, substitute it with the positions of the corresponding letter from the table that we have in method 2. If a letter that corresponds to the character has multiple occurences, randomize it, get the unique result from it and substitute it to the character. Repeat until all characters of the base64 string is processed. So this is what the decoder should do 1.) Read the reference matrix and make a table of letters and the position of occurences of the letters. Use the table to decode the appended encrypted text to base64 string. Finally, use base64 to decode the string. See the key is the Reference Matrix. It is suggested that the Reference Matrix should be large. It doesn't matter if it will slow down the process. A slow process means that a cracker has to wait for the resulting cypher text to be generated, and this scenario is in our advantage. So I have presented you the "Noob Cypher."