Toolbox::CryptOTP

Play around with one-time-pad type encryption.
Download

Toolbox::CryptOTP Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jason Leane
  • Publisher web site:
  • http://search.cpan.org/~docg/

Toolbox::CryptOTP Tags


Toolbox::CryptOTP Description

Play around with one-time-pad type encryption. Toolbox::CryptOTP is a Perl module that allows you to play around with one-time-pad type encryption.SYNOPSIS use Toolbox::CryptOTP; $plaintextfile = "doc.txt"; # Generate a random pad $pad_file = rand_pad("mypad.otp"); # Encrypt a file encrypt_file($plaintextfile, "ciphertext.txt", "mypad.otp"); # Decrypt it back decrypt_file("ciphertext.txt", "decrypted-plain.txt", "mypad.otp"); # Encrypt a string $plaintext = "Squeamish Ossifrage"; $garbage = encrypt_string($plaintext, 'f4'); # Decrypt it back $text = decrypt_string($garbage, 'f4');A module meant for those interested in learning abotu cryptography... the methods used here are not MEANT to be secure, and should be used solely to understand the principles of encryption. DO NOT use any function in this module to attempt to protect sensitive data.These functions implement "One-Time-Pad" encryption. For the file encryption/decryption functions, you specify another file as the 'pad'. One block is read from this file, and applied to each block of the input (NOTE: this is a BIG security flaw). If you run the output back through, with an IDENTICAL pad, you should recover the plaintext.For more information, see "Internet Cryptography" by Richard E. Smith. It covers this topic and many others.encrypt_file(input, output, pad) decrypt_file(input, output, pad)Encrypts or decrypts a file. For encryption, the input is plaintext, the output is ciphertext. For decryption, the input is ciphertext, the output is plaintext. The pad is shared between both functions. All arguments are filenames (not fileHANDLES).encrypt_string("string", 'FF') decrypt_string("f2fe3222", 'FF')Encrypts or decrypts a string. The pad is given as a two-digit hexadecimal number (00 - FF). It is applied to each character of the plaintext/ciphertext. Returns either ciphertext of plaintext.rand_pad("filename.pad")Generates a somewhat-random pad file, BLOCKSIZE bytes long. Use this if you can't locate a pad file of your own... Requirements: · Perl


Toolbox::CryptOTP Related Software