delphi-openssl
所属分类:Pascal/Delphi编程
开发工具:Delphi
文件大小:76KB
下载次数:37
上传日期:2017-09-08 08:11:41
上 传 者:
Maico
说明: OpenSSL library for Delphi
文件列表:
delphi-openssl (0, 2016-10-19)
delphi-openssl\.hg (0, 2016-10-19)
delphi-openssl\.hgignore (139, 2016-10-19)
delphi-openssl\.hg\00changelog.i (57, 2016-10-19)
delphi-openssl\.hg\branch (8, 2016-10-19)
delphi-openssl\.hg\cache (0, 2016-10-19)
delphi-openssl\.hg\cache\branch2-served (95, 2016-10-19)
delphi-openssl\.hg\cache\rbc-names-v1 (7, 2016-10-19)
delphi-openssl\.hg\cache\rbc-revs-v1 (112, 2016-10-19)
delphi-openssl\.hg\cache\tags2-visible (44, 2016-10-19)
delphi-openssl\.hg\dirstate (922, 2016-10-19)
delphi-openssl\.hg\hgrc (517, 2016-10-19)
delphi-openssl\.hg\requires (46, 2016-10-19)
delphi-openssl\.hg\store (0, 2016-10-19)
delphi-openssl\.hg\store\00changelog.i (2979, 2016-10-19)
delphi-openssl\.hg\store\00manifest.i (4395, 2016-10-19)
delphi-openssl\.hg\store\data (0, 2016-10-19)
delphi-openssl\.hg\store\data\_r_e_a_d_m_e.md.i (1904, 2016-10-19)
delphi-openssl\.hg\store\data\_samples (0, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo (0, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo.dpr.i (974, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo.dproj.i (4508, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo.res.i (1584, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo._enc_frame.dfm.i (1314, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo._enc_frame.pas.i (1196, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo._main_form.dfm.i (2180, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo._main_form.pas.i (2719, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo._main_frame.dfm.i (919, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo._main_frame.pas.i (1500, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo._r_s_a_buffer_frame.dfm.i (887, 2016-10-19)
delphi-openssl\.hg\store\data\_samples\_s_s_l_demo\_s_s_l_demo._r_s_a_buffer_frame.pas.i (1462, 2016-10-19)
delphi-openssl\.hg\store\data\_source (0, 2016-10-19)
delphi-openssl\.hg\store\data\_source\_open_s_s_l.libeay32.pas.i (2020, 2016-10-19)
delphi-openssl\.hg\store\data\_source\_open_s_s_l._core.pas.i (2555, 2016-10-19)
delphi-openssl\.hg\store\data\_source\_open_s_s_l._enc_utils.pas.i (4423, 2016-10-19)
delphi-openssl\.hg\store\data\_source\_open_s_s_l._r_s_a_utils.pas.i (4513, 2016-10-19)
delphi-openssl\.hg\store\data\_test_data (0, 2016-10-19)
delphi-openssl\.hg\store\data\_test_data\create__cert.bat.i (188, 2016-10-19)
delphi-openssl\.hg\store\data\_test_data\create__cert__pwd.bat.i (188, 2016-10-19)
delphi-openssl\.hg\store\data\~2ehgignore.i (254, 2016-10-19)
... ...
# Delphi OpenSSL Library
[Delphi](http://www.embarcadero.com/products/delphi) implementation of [OpenSSL](https://openssl.org/).
## Features
- Encrypt/Decrypt using RSA algorithm
- Symmetric cipher routines (for now only AES256)
- Base*** encoding e decoding
- Basic PAM support
## Usage
### Encrypt with the public key inside X509 certificate
*Command line:*
OpenSSL rsautl -encrypt -certin -inkey publiccert.cer -in test.txt -out test.txt.cry
*Source code:*
```
#!delphi
var
RSAUtil :TRSAUtil;
Cerificate :TX509Cerificate;
begin
RSAUtil := TRSAUtil.Create;
try
Cerificate := TX509Cerificate.Create;
try
Cerificate.LoadFromFile('publiccert.cer');
RSAUtil.PublicKey.LoadFromCertificate(Cerificate);
RSAUtil.PublicEncrypt('test.txt', 'test.txt.cry');
finally
Cerificate.Free;
end;
finally
RSAUtil.Free;
end;
end;
```
### Encrypt with the public key in PEM format
*Command line:*
OpenSSL rsautl -encrypt -pubin -inkey publickey.pem -in test.txt -out test.txt.cry
*Source code:*
```
#!delphi
var
RSAUtil :TRSAUtil;
begin
RSAUtil := TRSAUtil.Create;
try
RSAUtil.PublicKey.LoadFromFile('publickey.pem');
RSAUtil.PublicEncrypt('test.txt', 'test.txt.cry');
finally
RSAUtil.Free;
end;
end;
```
### Decrypt with the private key in PEM format
*Command line:*
OpenSSL rsautl -decrypt -inkey privatekey.pem -in test.txt.cry -out test.txt
*Source code:*
```
#!delphi
var
RSAUtil :TRSAUtil;
begin
RSAUtil := TRSAUtil.Create;
try
RSAUtil.PrivateKey.OnNeedPassphrase := PassphraseReader;
RSAUtil.PrivateKey.LoadFromFile('privatekey.pem');
RSAUtil.PrivateDecrypt('test.txt.cry', 'test.txt');
finally
RSAUtil.Free;
end;
end;
```
## Todo
- Symmetric cryptography (partially done)
- compute hash functions
- Sign e verify
- Generation of pseudo-random bit strings
- RSA data management
- Data managing for X509
- Manage information according to the PKCS #12 standard
## Prerequisite
OpenSSL library must be in your system path
## Installation
- Add the source path "Source" to your Delphi project path
- Run the demo and follow the tutorial
近期下载者:
相关文件:
收藏者: