How to make encrypt()/decrypt() produce same result in 16/32
How to make encrypt()/decrypt() produce same result in 16/32
How to enable encrypt()/decrypt() to produce the same result in 16 and 32 bits version? So far I noticed a 16-bit decrypt() can't correctly decrypt a string encrypted by a 32-bit encrypt().
Any help is much appreciated as it's quite urgent.
TIA.
Any help is much appreciated as it's quite urgent.
TIA.
Last edited by hua on Thu Mar 22, 2007 8:55 am, edited 1 time in total.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Sorry for the late reply Antonio. Got to finish other stuffs that were due first. A brief description about the following samples. There would be 2 exe involved. The 32-bit exe would be calling the 16-bit exe.
This is the code for the 32-bit exe. (FWH2.8+xHarbour 0.99.61)
And this is the code for the 16-bit exe. (FW2.3+Clipper 5.2)
The resulting string is not SUPERVISOR as expected.
This is the code for the 32-bit exe. (FWH2.8+xHarbour 0.99.61)
Code: Select all
#include "FiveWin.ch"
function Main()
local oDlg, oIco, cId := "SUPERVISOR"
DEFINE ICON oIco FILE "..\icons\fivewin.ico"
DEFINE DIALOG oDlg TITLE "I am a DialogBox" COLOR "W+/B" ;
ICON oIco
@ 3, 5 BUTTON "Run module" SIZE 40, 12 ;
ACTION winexec("exe16.exe "+encrypt(trim(cId)) )
ACTIVATE DIALOG oDlg CENTERED
return nil
Code: Select all
#include "fivewin.ch"
function main16(cID)
default cId := ""
msginfo(decrypt(trim(cID)))
return nil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- AlexSchaft
- Posts: 172
- Joined: Fri Oct 07, 2005 1:29 pm
- Location: Edenvale, Gauteng, South Africa
Passing encrypted strings
Hi,
Another trick I use where high (>127) ascii and low(<32) can be tricky is to mime encode the strings
and
Another trick I use where high (>127) ascii and low(<32) can be tricky is to mime encode the strings
Code: Select all
@ 3, 5 BUTTON "Run module" SIZE 40, 12 ;
ACTION winexec("exe16.exe "+cmimeenc(encrypt(trim(cId))) )
Code: Select all
msginfo(trim(decrypt(cmimedec(cId))))
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Hua,
>Thanks for the idea James. I just find it odd that if both the above samples are compiled in 16-bit I do get the expected string i.e. SUPERVISOR.
Granted that does seem odd. Are you using the same versions of FW and FWH? Perhaps there was a change in the versions that is causing the problem rather than 16bit vs 32bit.
James
>Thanks for the idea James. I just find it odd that if both the above samples are compiled in 16-bit I do get the expected string i.e. SUPERVISOR.
Granted that does seem odd. Are you using the same versions of FW and FWH? Perhaps there was a change in the versions that is causing the problem rather than 16bit vs 32bit.
James
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Unfortunately, the above didn't work James.James wrote: @ 3, 5 BUTTON "Run module" SIZE 40, 12 ;
ACTION winexec([exe16.exe ]+["]+encrypt(trim(cId))+["] )
No. I'm using FW2.3 and FWH2.8 respectively. I'm holding on to a time-tested principle, "if it ain't broken, don't fix it". Hence my reluctance to touch anything that's working fine so I left my 16-bit programs with FW16. I doubt there was a change, if there was, a lot more people would've been affected.James wrote: Granted that does seem odd. Are you using the same versions of FW and FWH? Perhaps there was a change in the versions that is causing the problem rather than 16bit vs 32bit.
Hey, that's a neat trick there Alex. I'll keep it in mind. I know it'd have never crossed my mind.AlexSchaft wrote: Another trick I use where high (>127) ascii and low(<32) can be tricky is to mime encode the strings