Re: Simple Encryption - what function/module could I use?
- From: chas.owens@xxxxxxxxx (Chas Owens)
- Date: Wed, 20 Jun 2007 11:10:43 -0400
On 6/20/07, yitzle <yitzle@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Without more information about why you want to encrypt something we
> can give no good advice; so here's some bad advice
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my $plaintext = do { local $/ = undef; <> };
> my $pad = "X" x length $plaintext;
>
> my $encryptedtext = $plaintext ^ $pad;
> my $decryptedtext = $encryptedtext ^ $pad;
> print "plaintext:\n$plaintext\n\nencryptedtext:\n$encryptedtext\n\n",
> "decryptedtext:\n$decryptedtext\n";
>
I like it! I just need a simple way to encypt text to store in a text
file. To protect sensitive info.
Thanks
Please note that obscuring the text with xor* is less effective than
using file permissions. If you are just trying to convince your boss
that the information is "safe" then this might be an acceptable
solution; however, the information is not safe. Any attacker could
easily undo the encryption in a short period of time and if the
attacker has access to the source code then he/she will be able to
break it instantly. If there are legal reasons for encrypting the
data, then this will not stand up in court as a reasonable attempt to
secure the data.
* unless you are using a truly randomly generated one-time-pad that is
used once and then thrown away, in which case it is the strongest form
of encryption.
.
- References:
- Simple Encryption - what function/module could I use?
- From: Yitzle
- Re: Simple Encryption - what function/module could I use?
- From: Chas Owens
- Re: Simple Encryption - what function/module could I use?
- From: Yitzle
- Simple Encryption - what function/module could I use?
- Prev by Date: Re: Alternatives to highly nested hashes
- Next by Date: Re: Simple Encryption - what function/module could I use?
- Previous by thread: Re: Simple Encryption - what function/module could I use?
- Next by thread: Re: Simple Encryption - what function/module could I use?
- Index(es):
Relevant Pages
|