Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Live Messenger > We cannot encrypt & decrypt messages in messenger with our dll fil

Reply
Thread Tools Display Modes

We cannot encrypt & decrypt messages in messenger with our dll fil

 
 
POLAT
Guest
Posts: n/a

 
      12-30-2007
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Messenger;
using System.Windows.Forms;

public class Konusma : IMessengerAddIn
{

private MessengerClient _client = null;

string[] ary = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
"l", "m", "n", "o", "p", "r", "s", "t", "u", "v", "y", "z" };

public string encrypt(string str)
{
int i = 0; int j = 0; string str1 = "";
for (i = 0; i < str.Length; i++)
{
for (j = 0; j < 23; j++)
{
if (str.Substring(i, 1) == ary[j])
str1 = str1 + ary[(j + 3 + 23) % 23];
}
}
return str1;
}


public string decrypt(string str)
{
int i = 0; int j = 0; string str1 = "";
for (i = 0; i < str.Length; i++)
{
for (j = 0; j < 23; j++)
{
if (str.Substring(i, 1) == ary[j])
str1 = str1 + ary[(j - 3 + 23) % 23];
}
}
return str1;
}

public void Initialize(MessengerClient messenger)
{
Client = messenger;
initAddin();
}

public MessengerClient Client
{
get
{
return _client;
}
private set
{
_client = value;
}
}

private void initAddin()
{

Client.AddInProperties.Status = UserStatus.Online;



Client.IncomingTextMessage += new
EventHandler<IncomingTextMessageEventArgs>(Client_ IncomingTextMessage);

Client.OutgoingTextMessage += new
EventHandler<OutgoingTextMessageEventArgs>(Client_ OutgoingTextMessage);

}


void Client_OutgoingTextMessage(object sender,
OutgoingTextMessageEventArgs e)
{
//string cipherText = encrypt(e.TextMessage);
//e.Cancel = true;
//MessageBox.Show("Cipher text length(" + cipherText + ") is: " +
cipherText.Length);
//Client.SendTextMessage(cipherText, e.UserTo);
}


void Client_IncomingTextMessage(object sender,
IncomingTextMessageEventArgs e)
{

string plainText = decrypt(e.TextMessage);
MessageBox.Show("Plain text length(" + plainText + ") is: " +
plainText.Length);
MessageBox.Show(plainText);

}


}

****************************************
Hi,
Our problem is that if two messenger client (e.g. one is called Bob and the
other is called Jane) (Both of them use dll file as shown above) and if Bob
writes sth obviously dll takes it and encrypt this according to encrypt
function , but Jane gets encrypted message but Incoming_Message function is
not working. So Jane just gets encrypted message. Our aim is as specified in
the source code of dll file. But I wanna say it again . If Bob writes sth,
Bob's dll will encrypt its writing, and Jane gets this encrypted string and
it's showed at the coming text box in the Jane's messenger and then Jane's
dll gets this and decrypts this string then result is shown in the message
box to Jane. But this two dll can't run at simultaneously.We added same dll
to the two messenger.


p.s. You can download our project in this adress
http://rs73.rapidshare.com/files/80058220/Peltek.rar
 
Reply With Quote
 
 
 
 
POLAT
Guest
Posts: n/a

 
      12-31-2007
Hey I upload a picture about telling the problem of my project

Web : http://rapidshare.com/files/80305520/polat.JPG.html
 
Reply With Quote
 
Matti-Koopa
Guest
Posts: n/a

 
      01-01-2008
Look here:
http://forums.microsoft.com/MSDN/Sho...45980&SiteID=1

Sadly the add-in function of WLM is very limited and still very 'bugy'.
It isn't really supported and documented as well that makes it even harder.

I am writing an add-in for WLM as well but I couldn't do that without
external COM-features.
Maybe you have to find an alternative way to send your messages out. But
that wouldn't be easy.


"POLAT" <> wrote in message
news:66B33A83-90C9-4BA9-A1D9-...
> using System;
> using System.Collections.Generic;
> using System.Text;
> using Microsoft.Messenger;
> using System.Windows.Forms;
>
> public class Konusma : IMessengerAddIn
> {
>
> private MessengerClient _client = null;
>
> string[] ary = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
> "l", "m", "n", "o", "p", "r", "s", "t", "u", "v", "y", "z" };
>
> public string encrypt(string str)
> {
> int i = 0; int j = 0; string str1 = "";
> for (i = 0; i < str.Length; i++)
> {
> for (j = 0; j < 23; j++)
> {
> if (str.Substring(i, 1) == ary[j])
> str1 = str1 + ary[(j + 3 + 23) % 23];
> }
> }
> return str1;
> }
>
>
> public string decrypt(string str)
> {
> int i = 0; int j = 0; string str1 = "";
> for (i = 0; i < str.Length; i++)
> {
> for (j = 0; j < 23; j++)
> {
> if (str.Substring(i, 1) == ary[j])
> str1 = str1 + ary[(j - 3 + 23) % 23];
> }
> }
> return str1;
> }
>
> public void Initialize(MessengerClient messenger)
> {
> Client = messenger;
> initAddin();
> }
>
> public MessengerClient Client
> {
> get
> {
> return _client;
> }
> private set
> {
> _client = value;
> }
> }
>
> private void initAddin()
> {
>
> Client.AddInProperties.Status = UserStatus.Online;
>
>
>
> Client.IncomingTextMessage += new
> EventHandler<IncomingTextMessageEventArgs>(Client_ IncomingTextMessage);
>
> Client.OutgoingTextMessage += new
> EventHandler<OutgoingTextMessageEventArgs>(Client_ OutgoingTextMessage);
>
> }
>
>
> void Client_OutgoingTextMessage(object sender,
> OutgoingTextMessageEventArgs e)
> {
> //string cipherText = encrypt(e.TextMessage);
> //e.Cancel = true;
> //MessageBox.Show("Cipher text length(" + cipherText + ") is: " +
> cipherText.Length);
> //Client.SendTextMessage(cipherText, e.UserTo);
> }
>
>
> void Client_IncomingTextMessage(object sender,
> IncomingTextMessageEventArgs e)
> {
>
> string plainText = decrypt(e.TextMessage);
> MessageBox.Show("Plain text length(" + plainText + ") is: " +
> plainText.Length);
> MessageBox.Show(plainText);
>
> }
>
>
> }
>
> ****************************************
> Hi,
> Our problem is that if two messenger client (e.g. one is called Bob and
> the
> other is called Jane) (Both of them use dll file as shown above) and if
> Bob
> writes sth obviously dll takes it and encrypt this according to encrypt
> function , but Jane gets encrypted message but Incoming_Message function
> is
> not working. So Jane just gets encrypted message. Our aim is as specified
> in
> the source code of dll file. But I wanna say it again . If Bob writes sth,
> Bob's dll will encrypt its writing, and Jane gets this encrypted string
> and
> it's showed at the coming text box in the Jane's messenger and then Jane's
> dll gets this and decrypts this string then result is shown in the
> message
> box to Jane. But this two dll can't run at simultaneously.We added same
> dll
> to the two messenger.
>
>
> p.s. You can download our project in this adress
> http://rs73.rapidshare.com/files/80058220/Peltek.rar


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encrypt File / Decrypt File / Open/Close PSD JAH Windows Vista General Discussion 2 04-29-2008 12:28 PM
Decrypt Data abhishek Windows Vista Security 1 11-22-2007 07:19 PM
Digitally Sign and Encrypt Messages support arasaka Windows Live Mail 1 03-20-2007 01:10 AM
Encrypt/ Decrypt in NdisIM with Ethernet Hien Nguyen Windows Vista Drivers 20 05-05-2005 04:59 PM
Encrypt Instant Messages Russ Windows MSN Messenger 3 12-30-2003 08:30 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59