I am doing a cryptography program in Python.
It consists in reading a random phrase, like HELLO
. Then it assigns it's respective ASCII values like:
H = 72, E = 79.
Then, using Pythagoras' Theorem, it creates two numbers C1
and C2
, like this:
C1 = sqrt(A^2 + (A+B)^2);
C2 = sqrt(B^2 + (A+B)^2)
I actually figured out how to solve the equations for B and A, but...It gives me a whole bunch of possible values for A and B. Is there any way by codding to select the ones I actually need?
Or just throw away that idea?
Do you have examples for encryptation on python?