int0x76

Caesar Cipher

Aug 26th, 2013
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. Caesar Cipher: ROT
  2.  
  3. MOD Arithmetic can be used determine a secret key
  4.  
  5. Our definition of congruent integers can be very helpful if we are to determine whether a fancy encryption like ROT1253 - which uses the encoding function f : P  P+1253 - will produce the same encryption as ROT0 (which we don’t want to use) or ROT1 or …. ROT25 ? Here is how, plain and simple: 1253=48*26+5 where the remainder of 5 tells us that we have to turn our disk 5 positions to the right (“ROT5”-encryption) to obtain our cipher letters. We ignored the redundant 48 full turns. I.e. when encoding the plain letter Y, the shift by 5 to the right yields the cipher letter d.
  6.  
  7. CONCLUSION:
  8. In order to determine which encryption “ROT N” yields we simply have to divide N by the modulus 26. The obtained remainder R – which must be a number between 0 and 25 – tells us the number of shifts to encrypt since N is congruent to R mod 26: N = R mod 26.
  9.  
  10. Awesome! We have discovered a criterion that helps us to determine immediately how many position shifts we have to do given any ROT number as a secret key. For example, ROT5, ROT31, ROT57, ROT 161 and ROT1253 encryptions eventually end up 5 positions to the right. ROT3, ROT29, ROT55, ROT81, ROT107 encryptions eventually end up 3 positions to the right and thus shift the same plain letters to the same cipher letters. Furthermore, a shift of 5 letters to the right is identical to a 21-position-shift to the left (we denote it as ROT(-21)) and also to a 47-position-shift to the left (ROT(-47)) on the Caesar Disk.
  11.  
  12. On Caesar Disks:
  13.  
  14. …=ROT(-47)= ROT(-21)==ROT5=ROT31=ROT57=ROT 83=…
  15. ...=ROT(-49)= ROT(-23)==ROT3=ROT29=ROT55=ROT 81=….
Advertisement
Add Comment
Please, Sign In to add comment