Thread View: microsoft.public.dotnet.framework.compactframework
1 messages
1 total messages
Started by Zief
Tue, 08 Aug 2006 15:50
Blowfish encryption between languages and platforms
Author: Zief
Date: Tue, 08 Aug 2006 15:50
Date: Tue, 08 Aug 2006 15:50
48 lines
3089 bytes
3089 bytes
Hi,
These may not be the correct places to post this message, but since I
am trying to make my Windows Mobile program decrypt strings from a
different PC Delphi program, I thought I'd start off here and if anyone
has any suggestions for posting elsewhere let me know.
Basically I have a Delphi program which is encrypting user passwords
using a blowfish algorithm taken from a free to use module called
LbCipher.pas that was originally used in TurboPower Lockbox (it seems
from the comment on the file, it is not from a project I have done).
This will take the password of "pass" (without the quotes) and return
"EEb+053WU2Q=" using the following lines of code in delphi and the key
shown:
function BlowFishString(UserStr : string) : string;
var
Key128 : TKey128;
begin
GenerateLMDKey(Key128, SizeOf(Key128), '1jkdjmc8743hj3euyd87');
Result := BFEncryptStringEx(UserStr, Key128, True);
end;
On the Windows Mobile side, I found Markus Hahn's page and am using his
BlowfishSimple class in C# to attempt to encrypt/decrypt strings. This
is where the problem appears, it may be a simple fix, but I am not
entirely sure how it all works.
The BlowfishSimple class using the following code:
// create the same key as used in the Delphi program
string tst = "1jkdjmc8743hj3euyd87";
BlowfishSimple test = new BlowfishSimple(tst);
string encrtest = test.Encrypt("pass");
string decr = test.Decrypt(encrtest);
encrtest is much bigger than "EEb+053WU2Q=" but on the last line it
decrypts fine back to "pass".
Does anyone have any idea how I can make the two compatible. Preferably
by changing the BlowfishSimple class in C# rather than the Delphi
program, as the Delphi program has already been rolled out and is in
use and would require much more effort to bring in line with the
Windows Mobile version.
Thanks in advance,
Zief
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads