Nov-28-2019, 05:47 PM
Hi, I have this program that ciphers text. The output for "This is a test!" would be:
Once the base_number is removed from the output so it's easier to decipher the output would be (you can't see this, this is a process made by the program):
As English is not my first language I don't think I'm being clear enough so here is an example:
With the output showed above, I want to make this:
The problem is the program doesn't tell me when one number ends, so i have to divide them in the program which is difficult because each number can have between 1 and 15 figures.
So, How would you do this?
I have tried to solve it but failed many times. I thinking in maybe changing the way the cipher works so that it is easier to decipher but I don't like that idea.
My two solutions are to add a special character at the end of each value to show that that is the end of the number. Or to make the ciphering program so that the value for a character is an only value instead of a value between two numbers.
Thanks for reading!
P.S: I have posted this on r/learnpython but haven't been able to solve the problem.
Output:2925596241966444785172913025754527297312947115361659656775S59817385191117554527297312947115361659656
775598173851911175H3479611511221598173851911175122738400274141N3062332593012311536165965677512273840
0274141E402651955633231FIFTFOGNT
To decipher the code the program first converts those letters (which in a longer text would be mixed with the numbers, but if the ciphered text is short they just stay in the back) to numbers. This numbers make the base_number which is needed to give a character (from a list of cipherable characters) a maximum value it could have. This is because a character can have a value between the maximum value the character could have + 1. The base_number in this case is 639744482 so the first letter in the cipherable characters list is "a" so it would have a value between 1 and the base_number in the case of "b" it would have a value between base_number + 1 and base_number * 2 .Once the base_number is removed from the output so it's easier to decipher the output would be (you can't see this, this is a process made by the program):
Output:2925596241966444785172913025754527297312947115361659656775S59817385191117554527297312947115361659656
77559817385191117534796115112215981738519111751227384002741413062332593012311536165965677512273840
0274141402651955633231O
So there is my problem. I can't find a solution on how to get each number so I can decipher it. What i mean is that i need to get a number, for example 2323232 (which is be between 1 and 639744482) so it's an "a". But I don't know how to slice the outpu so that I get each value for a character correctly.As English is not my first language I don't think I'm being clear enough so here is an example:
With the output showed above, I want to make this:
Output:ciphered_nums_list = [[29255962], [19664447851729], [130257545], [272973129471153616], [59656775S598173851911175] [5452729731294711536165965677], [5598173851911175347961151122], [159817385191117512273], [840027414130623325930], [12311536165965677512273840],
[0274141402651955633231O], ]
So once from there I could get each number from the list and compare it to see if it is between one number and another number, and if it is, return that character.The problem is the program doesn't tell me when one number ends, so i have to divide them in the program which is difficult because each number can have between 1 and 15 figures.
So, How would you do this?
I have tried to solve it but failed many times. I thinking in maybe changing the way the cipher works so that it is easier to decipher but I don't like that idea.
My two solutions are to add a special character at the end of each value to show that that is the end of the number. Or to make the ciphering program so that the value for a character is an only value instead of a value between two numbers.
Thanks for reading!
P.S: I have posted this on r/learnpython but haven't been able to solve the problem.