* (all files)
* stripped svn header
* minor cleanups
; use following command to find out the history of files:
git log
git log --follow
git blame
git annotate
44 lines
799 B
Plaintext
44 lines
799 B
Plaintext
/*
|
|
* Copyright 2009 Viktor Szakats (harbour syenar.net)
|
|
* www - http://harbour-project.org
|
|
*/
|
|
|
|
#require "hbssl"
|
|
|
|
PROCEDURE Main()
|
|
|
|
LOCAL ctx
|
|
LOCAL result
|
|
LOCAL encrypted
|
|
LOCAL decrypted
|
|
|
|
SSL_init()
|
|
|
|
OpenSSL_add_all_ciphers()
|
|
|
|
ctx := hb_EVP_ENCODE_ctx_create()
|
|
|
|
EVP_EncodeInit( ctx )
|
|
|
|
encrypted := ""
|
|
result := ""
|
|
EVP_EncodeUpdate( ctx, @result, "sample text" )
|
|
encrypted += result
|
|
EVP_EncodeFinal( ctx, @result )
|
|
encrypted += result
|
|
? "ENCRYTPTED", ">" + encrypted + "<"
|
|
|
|
ctx := hb_EVP_ENCODE_ctx_create()
|
|
|
|
EVP_DecodeInit( ctx )
|
|
|
|
decrypted := ""
|
|
result := ""
|
|
EVP_DecodeUpdate( ctx, @result, encrypted )
|
|
decrypted += result
|
|
EVP_DecodeFinal( ctx, @result )
|
|
decrypted += result
|
|
? "DECRYTPTED", ">" + decrypted + "<"
|
|
|
|
RETURN
|