Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Amfitrion
Wanderer


Joined: 29 Sep 2001
Posts: 75
Location: Israel

PostPosted: Fri May 10, 2002 11:53 am   

Encrypt
 
I am looking for a script that encrypts/decrypts a line according to predefined key.
Any body wrote something like this?

- Amfitrion.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri May 10, 2002 3:51 pm   
 
Yes, it's been done over and over. Search the forum and I'm sure you can easily find what you want. This one, input text processing, looks like your best bet.

General principle would be two variables, one with the unencrypted alphabet and the other with the encrypted one. Loop through the message, replacing each unencrypted letter with the encrypted one at the same position to encrypt. To unencrypt, replace each encrypted letter with the unencrypted one.

LightBulb
Vague questions get vague answers
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu May 23, 2002 3:56 am   
 
I'm remiss in tracking the orginal author was pulled from the forums.
Something I used a year ago where snoopy immortals were a pain.

#CLASS {General|Crypto} {enable|menu}
#ALIAS zDecrypt {#LOOP 1,26 {#VARIABLE zMsgDe %replace( @zMsgDe, %copy( @zBase, %i, 1), %copy( @zCode, %i, 1))};#VARIABLE zMsgDe {decoded @Code - %proper( @zMsgDe)};:Talk: zT @Friend tells you, ~'@zMsgDe~'}
#ALIAS zEncrypt {#VARIABLE zMsgEn %upper( @zMsgEn);#LOOP 1,26 {#VARIABLE zMsgEn %replace( @zMsgEn, %copy( @zCode, %i, 1), %copy( @zBase, %i, 1))};#VARIABLE zMsgEn {%proper( @zMsgEn)};tell @Friend z@Code ~- @zMsgEn}
#ALIAS zT {#VARIABLE Friend %1;#VARIABLE code %2;#VARIABLE zCode @z%2;#VARIABLE zMsgEn "%-3";#VARIABLE zMsgEn %copy( @zMsgEn, 2, %len( @zMsgEn));#VARIABLE zParam %numparam( );zEncrypt}
#VAR zBase {abcdefghijklmnopqrstuvwxyz}
#VAR zQwer {QWERTYUIOPASDFGHJKLZXCVBNM}
#VAR zmud {OLPKUMJNIHBTGVEFCRDXYSZWAQ}
#VAR ZmsgEn {Ecle ephl iyc kl bcss}
#VAR code {QWER}
#VAR zCode {QWERTYUIOPASDFGHJKLZXCVBNM}
#VAR Friend {Raillix}
#VAR zParam {7}
#VAR zMsgDe {decoded QWER - Test this one as well}
#TRIGGER {(%w) tells you, ~'z(%w) ~- (*)~'} {#VARIABLE Friend %1;#VARIABLE code %2;#VARIABLE zCode @z%2;#VARIABLE zMsgDe %lower( "%3");zDecrypt}
#TRIGGER {You tell (%w), ~'z(%w) ~- (*)~'} {#VARIABLE Friend %1;#VARIABLE code %2;#VARIABLE zCode @z%2;#VARIABLE zMsgDe %lower( "%3");zDecrypt}
#CLASS 0

Syntax use is somthing like:
zT friend zQwer - encrypt this message

where zQwer is the key

TonDiening
Beta Upgrading to 6.26
Reply with quote
NiteTrip
Novice


Joined: 21 May 2002
Posts: 40
Location: Canada

PostPosted: Sat May 25, 2002 4:34 am   
 
quote:

I am looking for a script that encrypts/decrypts a line according to predefined key.
Any body wrote something like this?

- Amfitrion.



I am working on one right now, should be real cool, randomly changes keys or changes at your command, just working out the final bugs and i'll post it. Probably another 3 days till I find the time, and plus I'm used to zmud 4.62 so all these new functions and crap got me learning scripting all over again, however it will be done soon :D
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat May 25, 2002 4:47 am   
 
zChat plug-in with the old pgp version ;) also works.

TonDiening
Beta Upgrading to 6.26
Reply with quote
NiteTrip
Novice


Joined: 21 May 2002
Posts: 40
Location: Canada

PostPosted: Sun May 26, 2002 6:53 am   
 
I posted the my encrypting script on the completed scripts board.

I still have loads of work to do, however the script as it is works, but it only has the one key, and a bit sloppy coding, cause i can't figure out how to make variables part of a class, any help on that one?

Anyhoo hope you enjoy it and the final version should be available in a few days, with changing keys, friend list, etc
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun May 26, 2002 11:12 pm   
 
quote:

I posted the my encrypting script on the completed scripts board.

I still have loads of work to do, however the script as it is works, but it only has the one key, and a bit sloppy coding, cause i can't figure out how to make variables part of a class, any help on that one?

Anyhoo hope you enjoy it and the final version should be available in a few days, with changing keys, friend list, etc



Well, you need to use the #VARIABLE command. #VARIABLE test "" _nodef "System|Keypad"

li'l shmoe of Dragon's Gate MUD
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net