Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Encrypt and Decrypt for text ... (http://www.velocityreviews.com/forums/t885097-encrypt-and-decrypt-for-text.html)

stratus 02-10-2004 12:46 AM

Encrypt and Decrypt for text ...
 
Is there any share tools in Unix,or even in PERL for encrypting the
ascii text to binary or anything else and decrypting it to ascii text.
Thanks a lot !!!

Or can tell me how to do it !!


Matt Garrish 02-10-2004 01:56 AM

Re: Encrypt and Decrypt for text ...
 

"stratus" <gis86508@cissol1.cis.nctu.edu.tw> wrote in message
news:c099ku$166k$1@news.cis.nctu.edu.tw...
> Is there any share tools in Unix,or even in PERL for encrypting the
> ascii text to binary or anything else and decrypting it to ascii text.
> Thanks a lot !!!
>


We don't deal in shareware here (and it's "are there" not "is there", and
Perl, not PERL). That you would even ask if such tools exists probably means
this is going to fall on deaf ears, but there are many modules on cpan that
deal with encrypting and decrypting all kinds of data.

Matt



James Willmore 02-10-2004 05:26 AM

Re: Encrypt and Decrypt for text ...
 
On Tue, 10 Feb 2004 00:46:22 +0000, stratus wrote:

> Is there any share tools in Unix,or even in PERL for encrypting the
> ascii text to binary or anything else and decrypting it to ascii text.
> Thanks a lot !!!
>
> Or can tell me how to do it !!


Converting (*not* encrypting) ASCII text to a binary format is *not* going
to hide your code (I'm thinking this was the point of your post, right?).

perldoc -q 'hide'

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Make it myself? But I'm a physical organic chemist!



Gregory Toomey 02-10-2004 06:00 AM

Re: Encrypt and Decrypt for text ...
 
stratus wrote:

> Is there any share tools in Unix,or even in PERL for encrypting the
> ascii text to binary or anything else and decrypting it to ascii text.
> Thanks a lot !!!
>
> Or can tell me how to do it !!


Assuming you are not trying to do anything naughty, search for "symmetric
encryption".
http://www.webopedia.com/TERM/S/symm...ncryption.html

The best known algorithm is DES
http://www.itl.nist.gov/fipspubs/fip46-2.htm


I have a quick-and-dirty Perl script that will encrypt a string of length s
into a longer string of length 2s, and a decryption routine that will take
the longer string and convert back to the original plaintext string.
You should be able to whip up something similar - just like baking a cake
but you invent your own recipe!

gtoomey

Walter Roberson 02-11-2004 08:24 AM

Re: Encrypt and Decrypt for text ...
 
In article <Xns948BE9C5BE28Fnothing@209.98.50.131>,
Klaas <spamhole@klaas.ca> wrote:
:Surely you jest? DES can be broken in a matter of hours.

Yes, it can be broken in a matter of hours -- if you devote several
thousand computers to the task. I would tend to doubt anyone would
bother for whatever the original poster intended to use the
encryption for.

Encryption doesn't have to be perfect: it just has to be good
enough to not be worth the bother of breaking.
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest

Matt Garrish 02-11-2004 11:54 PM

Re: Encrypt and Decrypt for text ...
 

"Klaas" <spamhole@klaas.ca> wrote in message
news:Xns948BE9C5BE28Fnothing@209.98.50.131...
> After careful consideration, Gregory Toomey muttered:
>
> > The best known algorithm is DES
> > http://www.itl.nist.gov/fipspubs/fip46-2.htm

>
> Surely you jest? DES can be broken in a matter of hours. AES is the
> current standard.
>


In all fairness, I think he meant best known in the sense of widely known,
not best available.

Matt



Ben Morrow 02-12-2004 01:51 AM

Re: Encrypt and Decrypt for text ...
 

Klaas <spamhole@klaas.ca> wrote:
> I agree. I was essentially objecting to the poster's characterizing DES
> as the best known algorithm (I should have realized he meant best-known).


Yay! Punctuation Pedants of the World Unite!

Ben

--
And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
* ben@morrow.me.uk *

Matt Garrish 02-12-2004 03:20 AM

Re: Encrypt and Decrypt for text ...
 

"Ben Morrow" <usenet@morrow.me.uk> wrote in message
news:c0em79$ish$1@wisteria.csv.warwick.ac.uk...
>
> Klaas <spamhole@klaas.ca> wrote:
> > I agree. I was essentially objecting to the poster's characterizing DES
> > as the best known algorithm (I should have realized he meant

best-known).
>
> Yay! Punctuation Pedants of the World Unite!
>


Our long-awaited call to arms! Quick, everyone to the Tower of Babel! : )

Matt



David K. Wall 02-12-2004 05:13 AM

Re: Encrypt and Decrypt for text ...
 
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote:

> Encryption doesn't have to be perfect: it just has to be good
> enough to not be worth the bother of breaking.


($encrypted = $plaintext) =~ tr/A-Za-z/N-ZA-Mn-za-m/;

is often good enough... :-)

In meetings, I often use runes from The Hobbit to make notes such as "This
person is just pushing their pet project" or "This is boring".


Tad McClellan 02-12-2004 01:01 PM

Re: Encrypt and Decrypt for text ...
 
David K. Wall <dwall@fastmail.fm> wrote:
> roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote:
>
>> Encryption doesn't have to be perfect: it just has to be good
>> enough to not be worth the bother of breaking.

>
> ($encrypted = $plaintext) =~ tr/A-Za-z/N-ZA-Mn-za-m/;
>
> is often good enough... :-)



And if the data is really really secret, encode it as above twice!


:-)


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas


All times are GMT. The time now is 11:13 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.