Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can anyone help with vfpencryption71.fll?
Message
From
07/03/2013 05:34:59
 
 
To
06/03/2013 16:06:01
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01567286
Message ID:
01567691
Views:
78
This message has been marked as a message which has helped to the initial question of the thread.
>I get various errors including not enough memory to run this operation.
>
>Thanks again,
>
>dg

I get the same error if I keep the hex value of the encryptedValue - see function DecryptionTestError() below
encryptedValue = "94342CF4186BC23839A8665A713C59E0"
Should be
encryptedValue = strconv("94342CF4186BC23839A8665A713C59E0",16)
Bear in mind that in the original function I used strconv(m.encryptedValue,15) to display the encrypted value
No where do you see that I used the hex presentation of the encryptedValue to decrypt
*_______________________________________________________________________________
function DecryptionTestError()

	set library to D:\tmp\In\vfpencryption90\vfpencryption.fll additive
	
	local	;
			cSecretKey, ;
			nEncryptionType, ;
			nKeySize, ;
			nEncryptionMode, ;
			nPaddingType, ;
			nBlockSize, ;
			cIV
		
	&& Encrypt

	nEncryptionType = 2 && or 0 or 1
	
	do case
	case m.nEncryptionType == 0
		nKeySize = 16
	
	case m.nEncryptionType == 1
		nKeySize = 24
	
	case m.nEncryptionType == 2
		nKeySize = 32
	
	otherwise
		error 'unknown nEncryptionType '
	
	endcase
	
	cSecretKey = padr('MyKey', m.nKeySize, chr(0))
	
	nEncryptionMode = 1 && CBC - we will need an IV
	
	nPaddingType = 4 && ISO 10126

	nBlockSize = 16 && or 24 or 32
	
	cIV = replicate(chr(0), m.nBlockSize) && Can be anything - but nBlockSize long
	
	local encryptedValue
	
	encryptedValue = "94342CF4186BC23839A8665A713C59E0"
	
	
	local decryptedValue
	
	decryptedValue= Decrypt(m.encryptedValue, m.cSecretKey, m.nEncryptionType, m.nEncryptionMode, m.nPaddingType, m.nKeySize, m.nBlockSize, m.cIv)
	
	? len(m.decryptedValue), m.decryptedValue

endfunc
*_______________________________________________________________________________	
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform