Note: This doesn't run under Windows 2000 (with up to date service packs)
I compiled the project, and it didn't run. It works fine under XP Home.
Just found this, and it DOES work on both platforms. I don't know why.
Code:Option Explicit Dim sSecretData sSecretData = "Here is some very secret data." ' Build up the key Dim wshNetwork, sComputerName Set wshNetwork = WScript.CreateObject("WScript.Network") sComputerName = wshNetwork.ComputerName Dim capEData Set capEData = CreateObject("CAPICOM.EncryptedData") capEData.Algorithm = 3 'Use 3DES capEData.SetSecret sComputerName capEData.Content = sSecretData Dim sCipherText sCipherText = capEData.Encrypt capEData.Algorithm = 3 capEData.SetSecret sComputerName capEData.Decrypt sCipherText Dim sPlainText sPlainText = capEData.Content MsgBox "Original data: " & sSecretData & chr(13) _ & "Encrypted data: " & sCipherText & chr(13) _ & "Recoverd data: " & sPlainText




Reply With Quote