TeleBoss 850 2.06.280_STD User Manual
Page 175
Example
-- check for message
message_id = a_lib.CheckMessages()
-- if it is shutdown request
if message_id == 13808 then
-- do graceful shutdown...
end
a_lib.Decrypt
Description
Decrypts ciphertext that was generated using the a_lib.Encrypt() function.
Syntax
a_lib.Decrypt(ciphertext, length)
ciphertext: String containing the ciphertext
length: Length of ciphertext string
Returns
Returns the decrypted data as a string, and the data length.
Example
a-- initialize encryption
my_key = "yaddayadda"
a_lib.InitEncryption(my_key, #my_key)
-- encrypt a message
message = "Hello world!"
ciphertext, ciphertext_length = a_lib.Encrypt(message, #message)
-- print the encrypted message
print(ciphertext)
<this will yield a bunch of garbage characters>
-- decrypt the message
decrypted_message = a_lib.Decrypt(ciphertext, ciphertext_length)
-- print it out
print(decrypted_message)
Hello world!
a_lib.Encrypt
Description
Encrypts data using the Blowfish encryption algorithm.
Syntax
a_lib.Encrypt(plaintext, length)
plaintext: String containing the data to encrypt
length: Length of plaintext string
Содержание Teleboss 850
Страница 6: ......