person( 1 ) M.toLowerCase() randRange(1,25) applyCaesar(M_LOWER, SHIFT) 0 25

M decides he wants to encrypt his name with a Caesar Cipher, using a shift of SHIFT.

What will his name look like after he encrypts it?

M decides she wants to encrypt her name with a Caesar Cipher, using a shift of SHIFT.

What will her name look like after she encrypts it?

You can use the below slider to help you encrypt the message.
Slide the orange dot to shift the encrypted alphabet.


Original Alphabet
var indent = 1; init({ range: [ [LOWER_BOUND - 0.5, UPPER_BOUND * indent + 0.5], [-1, 1] ], scale: [19, 40] }); style({arrows: ""}); line( [ 0, 0 ], [ UPPER_BOUND * indent, 0 ] ); style({arrows: ""}); line( [ 0, 0 ], [ LOWER_BOUND, 0 ] ); var myLabels = new Array(); style({arrows: ""}); for ( var x = LOWER_BOUND; x <= UPPER_BOUND; x+=1 ) { var markLength; x % 5 === 0 ? markLength = 0.2 : markLength = 0.1 line( [ x * indent, -markLength ], [ x * indent, markLength ] ); label( [ x * indent, 0.53 ], "abcdefghijklmnopqrstuvwxyz"[x], "center", false); myLabels[x] = label( [ x * indent, -0.53 ], "abcdefghijklmnopqrstuvwxyz"[x], "center", false); } addMouseLayer(); graph.movablePoint = addMovablePoint({ constraints: { constrainY: true }, snapX: indent }); graph.movablePoint.onMove = function( x, y ) { for ( var i = 0; i <= UPPER_BOUND; i+=1 ) { myLabels[i].remove(); myLabels[i] = label( [ i , -0.53 ], "abcdefghijklmnopqrstuvwxyz"[(i+x) % 26], "center", false); } return [ min( max( LOWER_BOUND, x ), UPPER_BOUND * indent ), y ]; };
Cipher Alphabet

C

  • C
  • C.substring(0,3) + applyCaesar(C,randRange(1,5)).substring(3)
  • applyCaesar(C,randRange(6,11))
  • applyCaesar(C,randRange(12,17))
  • applyCaesar(C,randRange(18,23))

We want to take each letter of the name and shift it right by SHIFT.

If we take the first letter M[0] and shift it right by SHIFT, we get the letter "abcdefghijklmnopqrstuvwxyz"[("abcdefghijklmnopqrstuvwxyz".indexOf(M_LOWER[0]) + SHIFT) % 26].

If we take the second letter M[1] and shift it right by SHIFT, we get the letter "abcdefghijklmnopqrstuvwxyz"[("abcdefghijklmnopqrstuvwxyz".indexOf(M_LOWER[1]) + SHIFT) % 26].

Continuing this for each letter, the final cipher output is “C