Chilkat Examples

ChilkatHOMEAndroid™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi DLLGoJavaNode.jsObjective-CPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwiftTclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Classic ASP Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Cert Store
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

AES Encrypted Self-Extracting Executable

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

This ASP script shows how to dynamically create an AES encrypted self-extracting executable and return it in the ASP Response

<%
' Return a self-extracting EXE created from in-memory data.
' Create a new instance of the ASP Zip compression component.
set zip = Server.CreateObject("Chilkat_9_5_0.Zip")

' Any value passed to UnlockComponent begins the 30-day trial.
unlocked = zip.UnlockComponent("30-day trial")
if unlocked then

	' Initialize the object.
	zip.NewZip "sfx.exe"

	' Append some strings to the Zip
	str = "Add this string as a file to the Zip object"
	zip.AppendString "string-1.txt",str

	str = "Here is another string to compress"
	zip.AppendString "string-2.txt",str

	Response.Buffer = True

	Response.Expires = 0
	
	Response.ContentType = "application/octet-stream"

	Response.AddHeader "Content-transfer-encoding", "binary"

	Response.AddHeader "Content-Disposition", "attachment;filename=sfx.exe"
	
	' Set the password and indicate that we want the output to be AES encrypted.
	zip.SetPassword "myPassword"
	' The key length can be 128, 192, or 256
	zip.EncryptKeyLength = 128
	' Choose an encryption algorithm.  
	' 0 = none, 1 = blowfish, 2 = twofish, 3 = AES (rijndael)
	zip.Encryption = 3

	' When writing self-extracting executables, the Chilkat Zip component uses
	' a temporary directory.  You will want to control the
	' location of this directory to make sure the Zip component
	' has permission in ASP.
	zip.TempDir = "c:/temp"

	' Customize our SFX a bit...
	zip.ExeTitle = "This is my self-extractor!"
	' There are also features to:
	' 1) Use a custom icon
	' 2) Automatically run an EXE from within the SFX after extracting.
	' 3) Automatically extract to a pre-set directory path.
	' 4) Automatically extract with no prompting or interface.
	' 5) Create AES encrypted self-extracting executables.
	
	' Write the Zip as a self-extracting executable
	' Returns 1 for success, 0 for failure.
	success = zip.WriteExe("c:/temp/sfx.exe")

	' Load the executable we just created into memory. Use the ChilkatCharset
	' component for the ReadFile convenience method, which makes it easy
	' to load binary files in ASP.  Chilkat Charset is a licensed (non-free)
	' component, so you may wish to load the binary file into memory in
	' another way.
	set cc = Server.CreateObject("Chilkat_9_5_0.Charset2")
	cc.UnlockComponent("30-day trial")
	exeImage = cc.ReadFile("c:/temp/sfx.exe")
	
	' Write the SFX to the ASP response
	Response.BinaryWrite(exeImage)

	Response.Flush()

end if

%>
 

© 2000-2026 Chilkat Software, Inc. All Rights Reserved.