|
1 | | -# Code_Alpha |
| 1 | +# Code_Alpha # |
2 | 2 | Cryptography API for Python |
| 3 | +____________________________ |
| 4 | +This is a simple cryptography service for Python. I created this during a mental ability class I was attending then. |
| 5 | +Basically, we all love to send messages that are really private that you don't want anyone else to see. So was it when the Germans working under the Nazi regime used the Enigma Machine to send coded stuff across the seas (unfortuantely, Alan J Turing broke into their secrets !). What if such a service is made available ? |
| 6 | + |
| 7 | +This is where Code_Alpha comes in . This is basically a coding - decoding mechanism crafted in Python using simple logic (one that even the greatest fool may understand). So, as a part of trying to be honest, here's how the code goes: |
| 8 | + |
| 9 | +1) Take a word (eg: HELLO). |
| 10 | +2) Write the position values of each letter in the word, i.e., for H it is 1, for E it is 2, etc. |
| 11 | + |
| 12 | + So what you'll get now is : |
| 13 | + ``` |
| 14 | + H E L L O |
| 15 | + 1 2 3 4 5 |
| 16 | + ``` |
| 17 | + 3) Subtract 1 from each number. This will give you the index of the word in a Python array. |
| 18 | + ``` |
| 19 | + H E L L O |
| 20 | + 0 1 2 3 4 |
| 21 | + ``` |
| 22 | + 4) With each index, transform the letter into a number using the formula : |
| 23 | + ``` |
| 24 | + 26 * (the index you take) + (value of the letter in the series of alphabets in order) |
| 25 | + ``` |
| 26 | + 5) Transcribe the word using the letters you get. |
| 27 | + |
| 28 | + Thus, HELLO is transformed into 8-31-64-90-119 . |
| 29 | + |
| 30 | + This is how the code works. Interesting, right ? |
| 31 | + If you input a sentence, each word in the sentence is transformed into the corresponding numeric code. |
| 32 | + |
| 33 | + # '20-34-53-92-115- 25-41-73-' |
| 34 | + code for "Thank you" |
| 35 | + ________________ |
| 36 | + |
| 37 | + PS : There are a few things to be noted : |
| 38 | + 1) Symbol transcription hasn't been made |
| 39 | + 2) No decoding service has been included in the current stage of development. |
| 40 | + 3) Contributers are welcome to make any change to the API to enhance its performance, its abilities, etc. |
0 commit comments