Shoutbox

[Release] Dencryptor v1.60 - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Release] Dencryptor v1.60 (/showthread.php?tid=66492)

[Release] Dencryptor v1.60 by phalanxii on 09-21-2006 at 06:23 AM

25 SEPTEMBER 2006
- DENCRYPTOR -
VERSION 1.60


Dencryptor (a mix between "encryptor" and "decryptor") is a script that uses a complex algorithm to encrypt and decrypt your messages. The encryption relies on a key, which can be customized so that no one (but those you choose) can read your messages.

Features: *New!

- Encrypt your message into a unique, incomprehensible encryption
- Decrypt your message into an understandable string
- Customizable key which protects your encryption
- *Five encryption character sets
- Custom block size for encryption
- *Splits messages for encryption if they are too long
- AutoEncrypt option to automatically encrypt your sent messages
- AutoDecrypt option to automatically decrypt your received messages
- *AutoKey option to automatically generate a key based on chosen contacts for AutoEncrypt and AutoDecrypt
- Save settings for multiple users
- *Configuration window

Usage:

- F3: Encrypts the text in your conversation typing box
- F4: Decrypts the text in your conversation typing box
- /DenAutoEncrypt <on/off> <key>: Automatically encrypt all your sent messages
- /DenAutoDecrypt <on/off> <key>: Automatically decrypt all your received messages
- /DenAutoDencrypt <on/off> <key>: Automatically encrypt and decrypt all your messages
- /DenAutoKey <on/off> <e-mails>: Automatically generate a key for AutoDencryption based on who you're talking to
- /DenBlockSize <size>: Change your block size for dencryption
- /DenCharacterSet <1-5>: Change your character set for dencryption
- /DenKey <key>: Change your dencryption key
- Commands are case-insensitive, second parameters are optional

Notes:

The encryption algorithm is very unique and relies on a key. When the script is started, your key is set to its default (your email).

An example of an encryption is:
code:
v29466FJ4LJmQ4h5L6gKji9LA4K296iKMKaml362954kGlEmH4d466pha
This is an encryption using a key of "ABC123". The algorithm is unique as it also employs a factor of randomness:
code:
6qLRJSTRwScSkSTSYSUSBP2R4SWPMswseR3sfrIpMris8s7sBsprjs3p2
This is in fact an encrypted form of the same message using the same key. Both encryptions, however, return the same string if the key is correct:
code:
Dencryptor is quite complex!
A slight change in the key will result in a complete change in the message. If the key is changed to "ABC1234", the message becomes an incomprehensible jumble. Even changing the case of one letter ("AbC123") will result in a major change in the decryption.

The following options are not particularly important, but can customize the appearance of your encryption and the amount of supported characters.

Dencryptor also comes with five character sets: Basic Latin, Latin-1, Latin Extended-A, Latin Extended-B and Latin Extended Additional. The Basic Latin character set (default) contains 62 characters (0-9, a-z and A-Z) while the Latin Extended Additional character set contains over 300. This means that the more complex character sets are capable of supporting more characters, though some characters may not be viewable by all contacts.

The size option also customizes the amount of supported characters. The default size is 2, meaning that each letter is represented by 2 digits (XX). Increasing this size will increase the amount of supported characters exponentially, but also add to the length of the encryption. The minimum size for the Basic Latin character set is 2 and 1 for the others. The maximum size for all sets is 5.

The AutoKey option is a function that is supposed to provide convenience to you and your cryptographic friends and works only with AutoEncrypt and/or AutoDecrypt enabled. The function generates a key based on the contact(s) that you choose. This key will be the same as the key which your friend generates if he chooses the same contact(s). For example, if you select your friend in AutoKey, and he/she selects you in AutoKey, the function will generate the same key for both of you to use. As such, you do not need to exchange a key with your friend. However, this also means that the key is potentially insecure, as others may be able to work out the key.


This script is mainly a "for fun" script, for if you want to talk to your friend in secret in a group conversation (and frustrate the other members). Note that the encryption (with a size more than 1) is many times longer than the original message, so you may want to be careful when sending long messages.

If there are any requests, I will try to implement them. Bug reports are appreciated. :)

[Image: dencryptorprefps3.th.png]
RE: [Release] Dencryptor v1.00 by NiteMare on 09-21-2006 at 06:52 AM

looks awsome, i might try it


RE: [Release] Dencryptor v1.20 by phalanxii on 09-23-2006 at 03:02 AM

Ok, I've updated the script to version 1.20. This version allows you to customize the amount of supported characters in the encryption (using /complex and /size) at the cost of the encryption's length. The new complex character set is more than 5 times the size of the original character set, and if set to the correct settings, the encryption can support Asian characters as well.

There is also a save feature so that you don't need to retype your settings every time you log in.

See the first post for details. Any feedback would be (Y)! Thanks!


RE: [Release] Dencryptor v1.20 by Chris4 on 09-23-2006 at 03:31 AM

That's a very cool script, very nice work (H).

How about a GUI? :)


RE: [Release] Dencryptor v1.20 by Matti on 09-23-2006 at 09:06 AM

Very cool script! :D
But what about an auto-decrypter set per contact? So, if you recieve an encoded message from a contact which you have on some list, it'll automatically decrypt the message using the presetted key. That way, you don't even have to decrypt it yourself and the others would hav no clue what you're talking about. :)


RE: RE: [Release] Dencryptor v1.20 by phalanxii on 09-23-2006 at 09:25 AM

quote:
Originally posted by Mattike
Very cool script! :D
But what about an auto-decrypter set per contact? So, if you recieve an encoded message from a contact which you have on some list, it'll automatically decrypt the message using the presetted key. That way, you don't even have to decrypt it yourself and the others would hav no clue what you're talking about. :)

Yes, I had that in mind, but for some reason, the OnEvent_ChatWndReceiveMessage wasn't working for me and it wouldn't show the text that I replaced it with. :@ I even tried replacing the received messages with "abc", and it still wouldn't change. If you could help me get that to work, that would be cool. (Y) (I have gotten it to work in the past, but for some reason, it's not working here. :()
RE: [Release] Dencryptor v1.20 by Shondoit on 09-23-2006 at 09:36 AM

The text it is replace with, shouldn't be longer than the original text...
(Not the case here, I think)
Just use:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
   var OtherMessage = "abc"
   return OtherMessage
}

If it doesn't work, try posting the code here...

-edit- and some minor suggestion, try to keep you scriptcommands together using a small prefix, something like denKey and denAutoEncrypt
It'll show up in a group in the ScriptCommands window


RE: [Release] Dencryptor v1.20 by Spunky on 09-23-2006 at 10:47 AM

If the source is openly editable by the user, it can be easily cracked can't it? Meaning that the whole thing would be useless? I'm liking the idea anyway and might give it a try for a bit :p


RE: [Release] Dencryptor v1.20 by phalanxii on 09-23-2006 at 11:05 AM

I never saved my original AutoDecrypt function because it never worked, but I recreated this one, which should be the same. (Note: This is for the normal encryption, without ASCII characters.)

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
   if(AutoDecrypt && /^[0-9a-z]+$/i.test(Message)) {
      var Decryption = Decrypt(Message, Key);
      if(Origin == Messenger.MyName) {
         Debug.Trace(" Encrypted message sent by current user.\n  Decrypted: " + Decryption);
         return Decryption;
      }
      else {
         Debug.Trace(" Encrypted message sent by contact.\n  Decrypted: " + Decryption);
         return Decryption;
      }
   }
}
From the debugger, the script knows when the message is an encryption and whether it is sent by yourself. It also displays the decryption properly. It's just in the conversation window that it doesn't show the decryption. (The decryption should technically be at least one character shorter than the encryption, though this is only when the size is 1. With the default of 2, the decryption is less than half the length.)
quote:
Originally posted by SpunkyLoveMuff
If the source is openly editable by the user, it can be easily cracked can't it? Meaning that the whole thing would be useless? I'm liking the idea anyway and might give it a try for a bit :p

Yes, I had thought about that, which is why I put in the whole key idea. :D Basically, you and the contact need to have the same key, otherwise you'll get completely random encryptions/decryptions. If you open up the source, you'll see that the encryption is VERY key-dependent:
   1. The key generates a cipher which the message is passed through.
   2. The key generates a sum (of the character codes) which adds and subtracts from each alternating character in the message.
That way, even if you know how to crack the code, you don't know what the key is to crack it with. :P

PS. Prefixed commands are on their way! ;)
RE: [Release] Dencryptor v1.20 by Spunky on 09-23-2006 at 11:07 AM

Unless you made a script to read the registry key or text file and got it to send back to you, or upload to a server :p


RE: [Release] Dencryptor v1.20 by phalanxii on 09-23-2006 at 11:13 AM

Rofl, personally, even if I knew how to, I wouldn't be bothered doing something like that just to read someone's encrypted 10 letter message. :)


RE: [Release] Dencryptor v1.20 by Spunky on 09-23-2006 at 11:22 AM

LMAO just pointing it out :p Doubt anyone would ever want to do it :D


RE: [Release] Dencryptor v1.20 by Shondoit on 09-23-2006 at 11:56 AM

The changing on receive works for me...
altough you use 'Auto' in your code, and 'AutoDecrypt' in the Receive function...

And a bug: commands get encrypted too, not your own commands, but when you try to change you status using '/away' the encrypted form gets send

I don't know how the key stuff works (yet) but you have a global key (per user) and you need that key to encode and decrypt the message, so the other user has to have the same global key, right? (not sure) than he sends an encrypted message to another contact, witht that same key, because it's used for encrypting and decrypting, wouldn't that mean that all the contacts need to have the same key?
I think you need to have a per user Key...


RE: [Release] Dencryptor v1.20 by phalanxii on 09-23-2006 at 12:12 PM

Yes, that's how it works, with a per user key. The way it works is that you and your contact will be talking using the same key. The problem is, your contact will somehow need to find out what key you are using in order to talk to you, which makes it kind of pointless. I may decide to make the key used for AutoEncrypt and AutoDecrypt related to the contacts' user ID's, so that you won't need to find out (that actually sounds like quite a good idea :D). If you have other ideas, suggest away!

As for the AutoDecrypt, I'll have to see if it is because it is being interfered with another script.
EDIT: Found the problem. It was being interfered by Choli's Linked Chats script. ;)

In the next release, I'll fix the command bug as well. (You can edit the script yourself if you want. :))

PS. Question: If I use multiple messengers (polygamy), do the global variables overlap? Also, anyone know how to make a list of contacts with checkboxes?

EDIT: Updated first post with bug fixes and AutoDecrypt. Now I'll probably get to work on fixing up the whole key thing. :S


RE: [Release] Dencryptor v1.27 by Jesus on 09-23-2006 at 05:02 PM

the encrypted strings are a lot longer than the original ones, maybe you can make it so that if the encrypted string is too long it will be sent in parts so you don't have to bother about the length of the message?


RE: [Release] Dencryptor v1.27 by Matti on 09-23-2006 at 05:07 PM

quote:
Originally posted by Jesus
the encrypted strings are a lot longer than the original ones, maybe you can make it so that if the encrypted string is too long it will be sent in parts so you don't have to bother about the length of the message?
Good idea, I think the encrypt function can pre-calculate the length of the encryption, so it can split and encrypt the separate strings. :)
* Matti looks at phalanxii... ^o)
RE: RE: [Release] Dencryptor v1.20 by CookieRevised on 09-23-2006 at 05:47 PM

quote:
Originally posted by phalanxii
Yes, that's how it works, with a per user key. The way it works is that you and your contact will be talking using the same key. The problem is, your contact will somehow need to find out what key you are using in order to talk to you, which makes it kind of pointless. I may decide to make the key used for AutoEncrypt and AutoDecrypt related to the contacts' user ID's, so that you won't need to find out (that actually sounds like quite a good idea :D).
If you want this because of added security, then I can say that would be pointless too...

All the 'hacker' needs to do is getting the other user's id and voila he can read those messages too.

eg: if you're in a multi convo window and you send an ecrypted key, it is dead easy to simply iterate thru all the contacts and decrypt the message using each individual contact userID.

So for starters, never ever send an encrypted text in a multi contact convo. Unless you take a look at how PGP works; private key and public key...

quote:
Originally posted by phalanxii
PS. Question: If I use multiple messengers (polygamy), do the global variables overlap?
no, they are different threads of the same script.

quote:
Originally posted by phalanxii
Also, anyone know how to make a list of contacts with checkboxes?
see various examples on the forum and released scripts.
RE: RE: [Release] Dencryptor v1.27 by phalanxii on 09-24-2006 at 01:29 AM

quote:
Originally posted by Mattike
quote:
Originally posted by Jesus
the encrypted strings are a lot longer than the original ones, maybe you can make it so that if the encrypted string is too long it will be sent in parts so you don't have to bother about the length of the message?
Good idea, I think the encrypt function can pre-calculate the length of the encryption, so it can split and encrypt the separate strings. :)
* Mattike looks at phalanxii... ^o)

Yes, that is quite a good idea. I'll definitely put that in (although how will it work with F3 and F4?). :) Just if you wanted to know, the length of the encryption is the block size times the original length plus one. (Y)

EDIT: Having trouble putting this one in... EDIT: Fixed!


@Cookie:
The user ID idea was probably not for security, but rather convenience. At the moment, the person that you send you're message to needs to know the key that you encrypted the message with, which I thought was a bit difficult in terms of practicality. (Note: This means that currently, you can send a message in a multi-contact conversation, as long as everyone else doesn't know the key.) But yes, I will probably need to reconsider the whole key concept, because as it stands, it is quite impractical (unless you don't mind telling your contact the key beforehand). However, like you said, using user IDs is also insecure. :S

Again, if anyone has any ideas as to how this should work, please suggest! :D

PS. Thanks for everybody's help so far! :) Also, thanks for answering my last few questions. (I think I've got the contact list on the way, but I'm not sure whether I'll use it...)

EDIT: I just read up on PGP, and public-key encryption and private-key decryption seems a little out of my league...

EDIT #2: At the moment, I'm inclined to think that the key system will have to be left as is. There is no way for the script to generate a key for two users without communication or find the key within the message without there being a security threat from someone else doing the same.
RE: [Release] Dencryptor v1.50 by phalanxii on 09-24-2006 at 11:54 AM

This is quite a major update (v1.50). The first post has most of the details. (THERE'S A NIFTY CONFIGURATION WINDOW!! :D)

However, I thought I might just clarify the use of AutoKey. To use AutoKey, you need to select the contacts that you wish to encrypt with. From there, it will generate a key based on you and your selected contacts. This key will be the same for each one of your contacts who select the same people. The point of this was to make it more convenient for people so that they do not always have to exchange keys.

The problem with this is, as Cookie has said, the AutoKey's key is crackable. Therefore, the use of AutoKey should be used with care, but for more security, do not use AutoKey, but instead use a custom one. (Y)