MarshallSoft

Visual dBase Advanced Encryption Standard (AES) Example


Function EncryptFile(KeyBuffer, InFile, OutFile)
Local Code
Local Control
Local Vector
' vector not used in ECM mode
Vector = Chr(0)
Control = "*"
' initialize for encryption in ECB mode
Code = aesInitAES(KeyBuffer, Vector, AES_ECB_MODE, AES_ENCRYPT, Control)
If Code < 0
  return Code
  exit
endif
' encrypt the file (InFile -> OutFile)
Code = aesEncryptFile(Control, InFile, OutFile)
return Code

MSC Logo

HOME PAGE
MARSHALLSOFT is a trademark of MarshallSoft Computing, Inc.