Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to call VFP function from .NET C# code?
Message
From
07/04/2015 03:22:54
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01612997
Message ID:
01617895
Views:
127
Likes (2)
>>I don't have the ID of the message (it has been almost 10 years since I got his code). And I don't care how he created this function (btw, "born" is a poor choice of a word :) ). His function works for me.
>>
>>>Here is what I found
>>>
>>>https://www.berezniker.com/content/pages/visual-foxpro/vfp-implementation-cipher-encryption
>>>
>>>So it does seem to be the same algorithm just in VFP code.
>
>BTW, in that page the code is not shown properly for me. It's truncated.
>
>I am saying, that the C# implementation is not working for high ASCII values and for us it's critical to make it work for all characters.


The very first thing to do is to understand how character encoding works ( ascii, ansi ( single byte and double byte code pages), unicode ( utf8, utf16 LE, utf16 BE, utf32 LE, utf32 BE) )
Second thing is that a char is a sequence of one or more bytes - depending on the encoding
Text ( aka a sequence of chars) is always encoded using an encoding scheme

Third thing to understand is that encryption works on bytes, not on chars

If you need it to be vfp compatible - make sure to use a common character encoding ( ie so that any char maps to the same sequence of bytes)

Then why not use AES or Rijndael
In .net there are classes for those
In vfp (1) Use craig Boyd's encryption, or (2) API's for AES, or (3) write your own in vfp code


For (2) AES API use (ECB or CBC, PKCS7 padding, key, IV)
For (1) and (3) use (ECB or CBC, PKCS7 or ANSIX923 or ISO10126 padding, key, IV)
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform