Encryption:

- Code: Select all
`alpha = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-+,./_!@#$%^&*()"`

message = "hello"

messList = [8, 5, 12, 12, 15] # the positions of each letter in message in the 'alpha' variable

for each of the numbers: this is basically my main encryption algo..

for the first letter 'h' or '8'

(8 * 2 ** 2)%79 # the second two is the first prime number and 79 is the length of the 'alpha' variable

for the second letter 'e' or '5'

(5 * 2 ** 3)%70 # the three is the second prime number

after this pattern occurs for the rest of the numbers:

I get:

[32, 40, 68, 35, 68]

then I put these values into 'alpha' and the encryption is complete:

hello = FN_I_

I can't seem to figure out how to reverse this, like going from [32, 40, 68, 35, 68] to [8, 5, 12, 12, 15]

Can someone please help me with this?