How to calculate Modulo using a standard calculator for a one time pad encryption I wrote a simple python script to preform one time pad encryption 
I would like to be able to decrypt the ciphertext by hand. In my script I use mod 26.

This is how I was shown to calculate a mod using a calculator:


467%26 = 25
467/26 = 17.9615...
17*26=442
467-442=25


I used this code to preform the one time pad in my script

ciphertext = plaintext+key%26
plaintext =  ciphertext-key%26


I’m using CT-46 to convert letters to numbers   

-----------------------------------------------------
|  A    E    I    N    O    R    |      CT-46       |
|  1    2    3    4    5    6    |                  |
|---------------------------------------------------|
|  B    C    D    F    G    H    J    K    L    M   |
|  70   71   72   73   74   75   76   77   78   79  |
|---------------------------------------------------|
|  P    Q    S    T    U    V    W    X    Y    Z   |
|  80   81   82   83   84   85   86   87   88   89  |
|---------------------------------------------------|
|  SPC  .    ,    :    ?    /    (    )    "  CODE  |
|  90   91   92   93   94   95   96   97   98   99  |
|---------------------------------------------------|
|  0    1    2    3    4    5    6    7    8    9   |
|  00   01   02   03   04   05   06   07   08   09  |
-----------------------------------------------------



plaintext = tavares -> CT-46 chart-> 83,1,85,1,6,2,82  
the key is 48,5,03,1,9,3,25  
ciphertext = 105,6,88,2,15,5,107


To decrypt the ciphertext you would do this in python:

105-48%26 = 83 that is T on the CT-46 chart 


Now if I try to decrypt by hand using a calculator, this is what I get:


105-48=57
57/26 = 2.1923076923076923076923076923077
2*26=52
57-52=5


The Difference should be 83, not 5. What is it that I'm doing wrong ?
In modular calculations such as this, the divisor (in your case 26) must be at least the size of your character code space. Your code space is 46 characters, so that is not going to work.

Any output of the modular calculation will be less than the divisor, so you will never get 83 for x mod 26, it is not going to happen. For a 46 character code space, 46 is the appropriate divisor.

Also the code space for your message characters is inconsistent, 06 codes to both "6" and "R". 92 will also code the same as 00 mod 46, so your code book values will never work. They must all be unique mod 46.

You have even more problems with your key and ciphertext. There was no modular calculation in generating your ciphertext, or all values would be less than 26. I also have no idea how you got 83+48=105, and 48 is once again outside the code space.