Help for this page

Select Code to Download


  1. or download this
    # Encrypter
    
    ...
    my $ciphertext2 = $ciphertext1 ^ $cipher->encrypt(substr($plaintext, 8
    +, 8));
    my $ciphertext = $ciphertext1 . $ciphertext2;
    my $websafe_ciphertext = substr(encode_base64($ciphertext, ''), 0, -2)
    +;
    
  2. or download this
    # Decrypter
    
    ...
    my $padded_plaintext = $cipher->decrypt(               $cyphertext1)
                         . $cipher->decrypt($ciphertext1 ^ $cyphertext2);
    my $plaintext = unpack('C/a*', $padded_plaintext);