[RESOLVED] Unicode Base64 string encrypt/decrypt
Does anyone have this function? I already got one but it's written for ANSI strings and not for Unicode. I have searched the Internet and found some functions with API but they're buggy, and I've read earlier somewhere that API calls for string encryption act differently on some Windows versions (and I'm asking if that is true?)
Re: Unicode Base64 string encrypt/decrypt
In the codebank section, Base64 routines exist. Any decent Base64 routine can process a byte array. To convert your string into a, 2-byte per character array, simply: myByteArray() = myUnicodeString
Re: Unicode Base64 string encrypt/decrypt
I have only found your function there for Base85 encoding but I can't get it to work properly with Unicode strings. Can you give me concrete example?
Re: Unicode Base64 string encrypt/decrypt
Base85 is probably not what you want. If you want to play with it more, then the zDecodeArray & zEncodeArray methods take, as the final parameter, the increment value which is passed as 2 in the sample code. Pass it as 1 to process every byte vs every other byte.
I thought CVMichael had a Base64 routine in the codebank. The one I use was modified from his. I might be able to post that later when I get home, I don't have it where I'm at now. However, you said you have a Base64 that works for ANSI. Does it process a byte array? If so, does it process every other byte (i.e., for x = y to z Step 2)? If so, remove the Step 2 portion of the loop so every byte is processed.
Re: Unicode Base64 string encrypt/decrypt
dilettante has a very nice, minimalist example here:
http://www.vbforums.com/showthread.p...=1#post3186994
I am not aware of any issues with the two relevant crypto API functions (CryptStringToBinary and CryptBinaryToString), and they are likely to be much faster than a VB-specific solution.
Re: Unicode Base64 string encrypt/decrypt
Thanks, Tanner_H! I think that my problem is now solved :)
@LaVolpe: Maybe I searched wrong because I've only used keyword "base64" but not "base 64". Thanks to you too for trying to help me, I appreciate that.
Re: Unicode Base64 string encrypt/decrypt
Quote:
Originally Posted by
Tanner_H
dilettante has a very nice, minimalist example...
Tanner, you forgot to precede that statement with, "Since XP is 6 feet under, ...." I know dilettante would've approved ;)
Re: [RESOLVED] Unicode Base64 string encrypt/decrypt
Those API calls are much fuller-featured on supported versions of Windows. ;)
Re: Unicode Base64 string encrypt/decrypt
Quote:
Originally Posted by
LaVolpe
Tanner, you forgot to precede that statement with, "Since XP is 6 feet under, ...." I know dilettante would've approved ;)
Yikes, you're absolutely right! Let me try this again:
Quote:
dilettante has a very nice, minimalist example to share, but it's not meant for delusional .NUT-cases or the unwashed plebeians who use disease-ridden filth like XP.
My apologies to all for not prefacing my original post correctly. :)
Re: [RESOLVED] Unicode Base64 string encrypt/decrypt
Wow I just got 100 new spam emails relayed through zombied XP machines.
Re: [RESOLVED] Unicode Base64 string encrypt/decrypt
The XP Zombie Apocalypse, Are You Ready?
Too late, that warning came a year ago.