Re: Simple Encryption - what function/module could I use?



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.
.



Relevant Pages

  • Re: own string class
    ... perhaps the same reason they'd "object" to me writing my own ... encryption or compression? ... It seems a lot of the time when I ask for advice about how to do something, ...
    (microsoft.public.vc.language)
  • Re: Protection!
    ... In addition to Mike's good advice re: ... a manual was supplied with your wireless hardware.. ... Encryption or? ... >> JCW ...
    (microsoft.public.windowsxp.newusers)
  • Re: Wireless security
    ... Since it is a criminal offence to protect data adequately using encryption* any other option is denied. ... there is only one type of encryption that is unbreakable by non-us agencies and that is not available to the likes of you and me. ... your advice to "assume that wifi devices are vulnerable and not keep anything on them that you would be unhappy to be in the public domain" is the best possible advice. ...
    (uk.business.agriculture)
  • Re: films on psp
    ... bought to transfer dvd onto om psp, for legal reasons. ... advice on what to do? ... get pspvideo9 and follow the instructions. ...
    (uk.games.video.playstation)
  • Re: Encrypted filesystem experience
    ... > There are an old advice to NOT encrypt a file twice with the same encryption ... There are rumors that doing a ROT-13 twice ... top-secret nobody is allowed to know, like the fact that there were no ...
    (alt.os.linux.suse)