As far as existing Crypto wrappers--Microsoft never bothered to create one for the CryptoAPI. That's kind of odd, but nevertheless...
Here's my thoughts on implementation:
An ActiveX control (DLL) that exclusively uses the CryptoAPI instead of something homegrown. One benefit of that would be to allow the scripter to select the type of encryption they would want, i.e. RC4, RSA, etc.
Or, for simplicity's sake, just hard-code one solution so it's easier to use.
Then when you have a password you want encrypted, for example, generate the encrypted string with a "dummy" script like:
Dim $Crypto
$Crypto = CreateObject("KixFunctions.Crypto")
$x = $Crypto.Encrypt("password")
? $x (let's pretend this returns "4rI92Hrk22pkl")
Then take the encrypted return and place that into the actual "protected" script wherever you need the password, for example:
USE E: "\\SERVER\PUBLIC" /user:Yogi /password:$Crypto.Decrypt("4rI92Hrk22pkl")
That seems to me the best way to go. At least that's what I have in my head. Any suggestions for a different implementation is more than welcome. Once we come up with a final plan, I'll go ahead and do it.
Quick question: Would allowing different encryption algorithms be a good idea? I'm thinking not since if you encrypt a string with one scheme and decrypt with another then you won't get a valid match. There's more chance for error.
Anyway, any thoughts?
Steve
_________________________
Stevie