-
Feb 25th, 2015, 03:29 PM
#1
Thread Starter
Hyperactive Member
[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?)
Last edited by MikiSoft; Feb 25th, 2015 at 03:33 PM.
-
Feb 25th, 2015, 03:40 PM
#2
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
-
Feb 25th, 2015, 04:10 PM
#3
Thread Starter
Hyperactive Member
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?
-
Feb 25th, 2015, 04:34 PM
#4
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.
-
Feb 25th, 2015, 04:55 PM
#5
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.
-
Feb 25th, 2015, 05:02 PM
#6
Thread Starter
Hyperactive Member
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.
Last edited by MikiSoft; Feb 25th, 2015 at 05:10 PM.
-
Feb 25th, 2015, 05:49 PM
#7
Re: Unicode Base64 string encrypt/decrypt
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
-
Feb 25th, 2015, 05:53 PM
#8
Re: [RESOLVED] Unicode Base64 string encrypt/decrypt
Those API calls are much fuller-featured on supported versions of Windows.
-
Feb 25th, 2015, 06:00 PM
#9
Re: Unicode Base64 string encrypt/decrypt
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:
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.
-
Feb 25th, 2015, 06:05 PM
#10
Re: [RESOLVED] Unicode Base64 string encrypt/decrypt
Wow I just got 100 new spam emails relayed through zombied XP machines.
-
Feb 25th, 2015, 06:11 PM
#11
Re: [RESOLVED] Unicode Base64 string encrypt/decrypt
The XP Zombie Apocalypse, Are You Ready?
Too late, that warning came a year ago.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|