Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Windows Live > Live Messenger

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

Reply
 
Old 12-30-2007   #1 (permalink)
POLAT


 
 

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

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

My System SpecsSystem Spec
Old 12-31-2007   #2 (permalink)
POLAT


 
 

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

Hey I upload a picture about telling the problem of my project

Web : http://rapidshare.com/files/80305520/polat.JPG.html
My System SpecsSystem Spec
Old 01-01-2008   #3 (permalink)
Matti-Koopa


 
 

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

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" <POLAT@xxxxxx> wrote in message
news:66B33A83-90C9-4BA9-A1D9-9BB80F064939@xxxxxx
Quote:

> 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
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Re:simple text encrypt / decrypt VB Script
Decrypt files Vista account administration
Encrypt File / Decrypt File / Open/Close PSD Vista General
Context Menu - Add Encrypt and Decrypt Tutorials
Encrypt or Decrypt a Folder or File Tutorials


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

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