(Classic ASP) Example: Crypt2.EncryptSb method
Demonstrates how to call the EncryptSb method.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Crypt2")
set crypt = Server.CreateObject("Chilkat.Crypt2")
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.BinData")
set bdEncrypted = Server.CreateObject("Chilkat.BinData")
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.StringBuilder")
set sbPlainText = Server.CreateObject("Chilkat.StringBuilder")
success = sbPlainText.Append("Text to be encrypted")
' ...
' Set the secret key ...
' Set properties such as CryptAlgorithm, CipherMode, PaddingScheme, KeyLength
' Set the IV if needed ...
' ...
crypt.Charset = "utf-8"
success = crypt.EncryptSb(sbPlainText,bdEncrypted)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( crypt.LastErrorText) & "</pre>"
Response.End
End If
%>
</body>
</html>
|