* contrib/hblzf/tests/hbmk.hbm
* contrib/hblzf/tests/test.prg
* contrib/hblzf/tests/test2.prg
* contrib/hbodbc/tests/hbmk.hbm
* contrib/hbodbc/tests/odbccall.prg
* contrib/hbodbc/tests/odbcdemo.prg
* contrib/hbodbc/tests/testodbc.prg
* contrib/hbssl/tests/bio.prg
* contrib/hbssl/tests/crypt.prg
* contrib/hbssl/tests/digest.prg
* contrib/hbssl/tests/encode.prg
* contrib/hbssl/tests/hbmk.hbm
* contrib/hbssl/tests/pem.prg
* contrib/hbssl/tests/test.prg
* contrib/hbtinymt/tests/hbmk.hbm
* contrib/hbtinymt/tests/test32.prg
* contrib/hbtinymt/tests/test64.prg
* contrib/hbxdiff/tests/hbmk.hbm
* contrib/hbxdiff/tests/test.prg
* contrib/hbxdiff/tests/test2.prg
* contrib/hbxdiff/tests/test3.prg
* contrib/hbziparc/tests/hbmk.hbm
* contrib/hbziparc/tests/unzipa.prg
* contrib/hbziparc/tests/zipa.prg
% moved simpleio.ch to hbmk.hbm
48 lines
815 B
Plaintext
48 lines
815 B
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* 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
|