Encrypt
The process of making data unreadable by other humans or computers for the purpose of preventing others from gaining access to its contents. Encrypted data is generated using an encryption program such as PGP, encryption machine, or a simple encryption key and appears as garbage until it is decrypted. In order to read or use the data, it must be decrypted and only those who have the correct password or decryption key are able to make the data readable again.
A very basic encryption technique known as simple substitution, substitution cipher, or Caesar cipher (named after Julius Caesar) shifts the letters of the alphabet over a few characters. For example, as shown below the alphabet has been shifted over four characters.
Encrypt key:
a=e, b=f, c=g, d=h, e=i, f=j, g=k, h=l, i=m, j=n, k=o, l=p, m=q, n=r, o=s, p=t, q=u, r=v, s=w, t=x, u=y, v=z, w=a, x=b, y=c and z=d.
Decrypt key:
a=w, b=x, c=y, d=z, e=a, f=b, g=c, h=d, i=e, j=f, k=g, l=h, m=i, n=j, o=k, p=l, q=m, r=n, s=o, t=p, u=q, v=r, w=s, x=t, y=u and z=v
Using this technique a user could encrypt the message: computer hope free help for everyone to: gsqtyxiv lsti jvii lipt jsv izivcsri. Below is an example of how this could be done using Perl.
my (%key, $new);
my $alpha = "abcdefghijklmnopqrstuvwxyz";
my $message = "computer hope free help for everyone";
@alpha = split(//, $alpha);
my $i=1;
foreach $alpha (@alpha) {
if ($i >= 23) { $i = -3; }
$key{$alpha} = $alpha[$i+3];
$i++;
}
@message = split(//,$message);
foreach $message (@message) {
if ($message =~/[a-z]/i) { $new .= "$key{$message}"; }
else { $new .= "$message"; }
}
print "Old: $message\nEncrypted: $new\n";
- How do I password protect my files and folders in Windows?
- What is a safe way to remember my passwords?
Also see: AES, Asymmetric Encryption, Cleartext, Cryptography, Decryption, DES, Key, MDC, Node encryption, PGP, Security definitions
