Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl -l
    
    ...
        print "Ciphertext: $input";
        print "Plaintext:  $plaintext";
    }
    
  2. or download this
    $ pm_caesar_cipher.pl def 1 1 3
    Transform: encrypt  --  Shift: right  --  Positions: 3
    Plaintext:  def
    Ciphertext: ghi
    
  3. or download this
    $ pm_caesar_cipher.pl ghi 0 1 3
    Transform: decrypt  --  Shift: right  --  Positions: 3
    Ciphertext: ghi
    Plaintext:  def
    
  4. or download this
    $ pm_caesar_cipher.pl def 1 0 3
    Transform: encrypt  --  Shift: left  --  Positions: 3
    Plaintext:  def
    Ciphertext: abc
    
  5. or download this
    $ pm_caesar_cipher.pl abc 0 0 3
    Transform: decrypt  --  Shift: left  --  Positions: 3
    Ciphertext: abc
    Plaintext:  def
    
  6. or download this
    $ pm_caesar_cipher.pl 'The quick brown fox jumped over the lazy dog.' 
    +1 1 145
    Transform: encrypt  --  Shift: right  --  Positions: 50
    Plaintext:  The quick brown fox jumped over the lazy dog.
    Ciphertext: ';8RDH<6>R5EBJAR9BKR=H@C87RBI8ERG;8R?4MLR7B:`
    
  7. or download this
    $ pm_caesar_cipher.pl "';8RDH<6>R5EBJAR9BKR=H@C87RBI8ERG;8R?4MLR7B:\`"
    + 0 1 145
    Transform: decrypt  --  Shift: right  --  Positions: 50
    Ciphertext: ';8RDH<6>R5EBJAR9BKR=H@C87RBI8ERG;8R?4MLR7B:`
    Plaintext:  The quick brown fox jumped over the lazy dog.
    
  8. or download this
    $ pm_caesar_cipher.pl
    Usage: ./pm_caesar_cipher.pl text encrypt/decrypt(1|0) right_shift/lef
    +t_shift(1|0) positions_to_shift
    (Note: when decrypting, '*_shift' and 'positions_to_shift' is what was
    + used for the original encryption!)