Classic ASP
Classic ASP
Example: Crypt2.EncryptSb method
Demonstrates how to call the EncryptSb method.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set crypt = Server.CreateObject("Chilkat.Crypt2")
set bdEncrypted = Server.CreateObject("Chilkat.BinData")
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>