├── source ├── LbDesign.dcr ├── LbDesign.dfm ├── LbKeyEd1.dfm ├── LbKeyEd2.dfm ├── LbQDesign.xfm ├── LbQKeyEd1.xfm ├── LbQKeyEd2.xfm ├── LbKeyEd2.pas ├── LbQKeyEd2.pas ├── LbQKeyEd1.pas ├── LbKeyEd1.pas ├── ExtraDeletes └── LockBox.inc ├── packages ├── L207_d30.res ├── L207_d35.res ├── L207_d40.res ├── L207_d41.res ├── L207_d50.res ├── L207_d51.res ├── L207_r30.res ├── L207_r35.res ├── L207_r40.res ├── L207_r41.res ├── L207_r50.res ├── L207_r51.res ├── L207_r60.res ├── L207_r61.res ├── L207_r70.res ├── L207cd60.res ├── L207cd70.res ├── L207vc61.res ├── L207vd60.res ├── L207vd61.res ├── L207vd70.res ├── tplockboxd.res ├── tplockboxr.res ├── tplockboxd.conf ├── tplockboxr.conf ├── buildrc ├── Makefile ├── L207_r61.cpp ├── L207vc61.cpp ├── l207_d30.dpk ├── L207vd61.cpp ├── L207_d40.dpk ├── l207_r30.dpk ├── L207_d50.dpk ├── L207vd60.dpk ├── L207vd70.dpk ├── tplockboxd.dpk ├── L207cd60.dpk ├── L207_d35.cpp ├── L207_d41.cpp ├── L207_d51.cpp ├── tplockboxr.dpk ├── L207cd70.dpk ├── L207_r41.cpp ├── L207_r51.cpp ├── L207_r35.cpp ├── L207_r60.dpk ├── L207_r70.dpk ├── L207_r40.dpk ├── L207_r50.dpk ├── L207vd70.dof ├── L207cd70.dof ├── L207_r51.bpk └── L207_d51.bpk ├── examples ├── Delphi │ ├── DSACmp.res │ ├── DSACmp1.dfm │ ├── DSASig1.dfm │ ├── DSASig2.dfm │ ├── ExFile1.dfm │ ├── ExHash.res │ ├── ExHash1.dfm │ ├── RDLCmp1.dfm │ ├── RSACmp1.dfm │ ├── RSAKeys.res │ ├── RSASSA.res │ ├── RSASSA1.dfm │ ├── DSAKeys1.dfm │ ├── ExRSAKe1.dfm │ ├── ExRSAKey.res │ ├── ExStrin1.dfm │ ├── HashCmp1.dfm │ ├── RSAKeys1.dfm │ ├── DSAKeys.dpr │ ├── ExFile.dpr │ ├── RDLCmp.dpr │ ├── RSACmp.dpr │ ├── ExString.dpr │ ├── DSACmp.dpr │ ├── ExHash.dpr │ ├── RSASSA.dpr │ ├── HashCmp.dpr │ ├── DSASig.dpr │ ├── ExRSAKey.dpr │ ├── RSAKeys.dpr │ ├── DSASig2.pas │ ├── ExAll.bpg │ ├── ExHash1.pas │ ├── RDLCmp1.pas │ ├── HashCmp1.pas │ ├── RSACmp1.pas │ ├── ExFile1.pas │ ├── ExStrin1.pas │ └── RSASSA1.pas ├── Kylix │ ├── DSACmp1.dfm │ ├── ExFile1.dfm │ ├── ExHash1.dfm │ ├── ExRSAKe1.dfm │ ├── ExStrin1.dfm │ ├── HashCmp1.dfm │ ├── RDLCmp1.dfm │ ├── RSACmp1.dfm │ ├── RSAKeys1.dfm │ ├── RSASSA1.dfm │ ├── ExFile.dpr │ ├── RDLCmp.dpr │ ├── RSACmp.dpr │ ├── ExString.dpr │ ├── DSACmp.dpr │ ├── ExHash.dpr │ ├── RSASSA.dpr │ ├── HashCmp.dpr │ ├── ExFile.conf │ ├── ExHash.conf │ ├── ExRSAKey.conf │ ├── ExString.conf │ ├── HashCmp.conf │ ├── RDLCmp.conf │ ├── RSACmp.conf │ ├── RSAKeys.conf │ ├── RSASSA.conf │ ├── ExRSAKey.dpr │ ├── DSACmp.conf │ ├── RSAKeys.dpr │ ├── ExHash1.pas │ ├── RDLCmp1.pas │ ├── HashCmp1.pas │ ├── RSACmp1.pas │ ├── ExFile1.pas │ ├── ExStrin1.pas │ └── RSASSA1.pas └── CBuilder │ ├── DSACmp.res │ ├── DSACmp1.dfm │ ├── DSAKeys.res │ ├── DSAKeys1.dfm │ ├── DSASig.res │ ├── DSASig1.dfm │ ├── DSASig2.dfm │ ├── ExFile.res │ ├── ExFile1.dfm │ ├── ExHash.res │ ├── ExHash1.dfm │ ├── ExRSAKe1.dfm │ ├── ExRSAKey.res │ ├── ExStrin1.dfm │ ├── ExString.res │ ├── HashCmp.res │ ├── HashCmp1.dfm │ ├── RDLCmp.res │ ├── RDLCmp1.dfm │ ├── RSACmp.res │ ├── RSACmp1.dfm │ ├── RSAKeys.res │ ├── RSAKeys1.dfm │ ├── RSASSA.res │ ├── RSASSA1.dfm │ ├── DSASig2.cpp │ ├── DSACmp.cpp │ ├── ExFile.cpp │ ├── ExHash.cpp │ ├── RDLCmp.cpp │ ├── RSACmp.cpp │ ├── RSASSA.cpp │ ├── ExRSAKey.cpp │ ├── ExString.cpp │ ├── HashCmp.cpp │ ├── RSAKeys.cpp │ ├── DSAKeys.cpp │ ├── DSASig.cpp │ ├── DSASig2.h │ ├── ExHash1.h │ ├── HashCmp1.h │ ├── ExStrin1.h │ ├── ExAll.bpg │ ├── ExFile1.h │ ├── RDLCmp1.h │ ├── RSACmp1.h │ ├── ExHash1.cpp │ ├── RSASSA1.h │ ├── RDLCmp1.cpp │ ├── HashCmp1.cpp │ ├── ExRSAKe1.h │ ├── RSAKeys1.h │ ├── DSACmp1.h │ ├── DSAKeys1.h │ ├── RSACmp1.cpp │ ├── RSASSA1.cpp │ ├── ExFile1.cpp │ ├── DSASig1.h │ ├── DSAKeys1.cpp │ └── ExStrin1.cpp ├── LICENSE ├── .gitignore └── readme.txt /source/LbDesign.dcr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/source/LbDesign.dcr -------------------------------------------------------------------------------- /source/LbDesign.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/source/LbDesign.dfm -------------------------------------------------------------------------------- /source/LbKeyEd1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/source/LbKeyEd1.dfm -------------------------------------------------------------------------------- /source/LbKeyEd2.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/source/LbKeyEd2.dfm -------------------------------------------------------------------------------- /source/LbQDesign.xfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/source/LbQDesign.xfm -------------------------------------------------------------------------------- /source/LbQKeyEd1.xfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/source/LbQKeyEd1.xfm -------------------------------------------------------------------------------- /source/LbQKeyEd2.xfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/source/LbQKeyEd2.xfm -------------------------------------------------------------------------------- /packages/L207_d30.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_d30.res -------------------------------------------------------------------------------- /packages/L207_d35.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_d35.res -------------------------------------------------------------------------------- /packages/L207_d40.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_d40.res -------------------------------------------------------------------------------- /packages/L207_d41.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_d41.res -------------------------------------------------------------------------------- /packages/L207_d50.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_d50.res -------------------------------------------------------------------------------- /packages/L207_d51.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_d51.res -------------------------------------------------------------------------------- /packages/L207_r30.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_r30.res -------------------------------------------------------------------------------- /packages/L207_r35.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_r35.res -------------------------------------------------------------------------------- /packages/L207_r40.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_r40.res -------------------------------------------------------------------------------- /packages/L207_r41.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_r41.res -------------------------------------------------------------------------------- /packages/L207_r50.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_r50.res -------------------------------------------------------------------------------- /packages/L207_r51.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_r51.res -------------------------------------------------------------------------------- /packages/L207_r60.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_r60.res -------------------------------------------------------------------------------- /packages/L207_r61.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_r61.res -------------------------------------------------------------------------------- /packages/L207_r70.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207_r70.res -------------------------------------------------------------------------------- /packages/L207cd60.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207cd60.res -------------------------------------------------------------------------------- /packages/L207cd70.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207cd70.res -------------------------------------------------------------------------------- /packages/L207vc61.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207vc61.res -------------------------------------------------------------------------------- /packages/L207vd60.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207vd60.res -------------------------------------------------------------------------------- /packages/L207vd61.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207vd61.res -------------------------------------------------------------------------------- /packages/L207vd70.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/L207vd70.res -------------------------------------------------------------------------------- /packages/tplockboxd.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/tplockboxd.res -------------------------------------------------------------------------------- /packages/tplockboxr.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/packages/tplockboxr.res -------------------------------------------------------------------------------- /examples/Delphi/DSACmp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/DSACmp.res -------------------------------------------------------------------------------- /examples/Delphi/DSACmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/DSACmp1.dfm -------------------------------------------------------------------------------- /examples/Delphi/DSASig1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/DSASig1.dfm -------------------------------------------------------------------------------- /examples/Delphi/DSASig2.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/DSASig2.dfm -------------------------------------------------------------------------------- /examples/Delphi/ExFile1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/ExFile1.dfm -------------------------------------------------------------------------------- /examples/Delphi/ExHash.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/ExHash.res -------------------------------------------------------------------------------- /examples/Delphi/ExHash1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/ExHash1.dfm -------------------------------------------------------------------------------- /examples/Delphi/RDLCmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/RDLCmp1.dfm -------------------------------------------------------------------------------- /examples/Delphi/RSACmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/RSACmp1.dfm -------------------------------------------------------------------------------- /examples/Delphi/RSAKeys.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/RSAKeys.res -------------------------------------------------------------------------------- /examples/Delphi/RSASSA.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/RSASSA.res -------------------------------------------------------------------------------- /examples/Delphi/RSASSA1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/RSASSA1.dfm -------------------------------------------------------------------------------- /examples/Kylix/DSACmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/DSACmp1.dfm -------------------------------------------------------------------------------- /examples/Kylix/ExFile1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/ExFile1.dfm -------------------------------------------------------------------------------- /examples/Kylix/ExHash1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/ExHash1.dfm -------------------------------------------------------------------------------- /examples/Kylix/ExRSAKe1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/ExRSAKe1.dfm -------------------------------------------------------------------------------- /examples/Kylix/ExStrin1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/ExStrin1.dfm -------------------------------------------------------------------------------- /examples/Kylix/HashCmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/HashCmp1.dfm -------------------------------------------------------------------------------- /examples/Kylix/RDLCmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/RDLCmp1.dfm -------------------------------------------------------------------------------- /examples/Kylix/RSACmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/RSACmp1.dfm -------------------------------------------------------------------------------- /examples/Kylix/RSAKeys1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/RSAKeys1.dfm -------------------------------------------------------------------------------- /examples/Kylix/RSASSA1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Kylix/RSASSA1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/DSACmp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/DSACmp.res -------------------------------------------------------------------------------- /examples/CBuilder/DSACmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/DSACmp1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/DSAKeys.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/DSAKeys.res -------------------------------------------------------------------------------- /examples/CBuilder/DSAKeys1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/DSAKeys1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/DSASig.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/DSASig.res -------------------------------------------------------------------------------- /examples/CBuilder/DSASig1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/DSASig1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/DSASig2.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/DSASig2.dfm -------------------------------------------------------------------------------- /examples/CBuilder/ExFile.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/ExFile.res -------------------------------------------------------------------------------- /examples/CBuilder/ExFile1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/ExFile1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/ExHash.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/ExHash.res -------------------------------------------------------------------------------- /examples/CBuilder/ExHash1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/ExHash1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/ExRSAKe1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/ExRSAKe1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/ExRSAKey.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/ExRSAKey.res -------------------------------------------------------------------------------- /examples/CBuilder/ExStrin1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/ExStrin1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/ExString.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/ExString.res -------------------------------------------------------------------------------- /examples/CBuilder/HashCmp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/HashCmp.res -------------------------------------------------------------------------------- /examples/CBuilder/HashCmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/HashCmp1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/RDLCmp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/RDLCmp.res -------------------------------------------------------------------------------- /examples/CBuilder/RDLCmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/RDLCmp1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/RSACmp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/RSACmp.res -------------------------------------------------------------------------------- /examples/CBuilder/RSACmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/RSACmp1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/RSAKeys.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/RSAKeys.res -------------------------------------------------------------------------------- /examples/CBuilder/RSAKeys1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/RSAKeys1.dfm -------------------------------------------------------------------------------- /examples/CBuilder/RSASSA.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/RSASSA.res -------------------------------------------------------------------------------- /examples/CBuilder/RSASSA1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/CBuilder/RSASSA1.dfm -------------------------------------------------------------------------------- /examples/Delphi/DSAKeys1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/DSAKeys1.dfm -------------------------------------------------------------------------------- /examples/Delphi/ExRSAKe1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/ExRSAKe1.dfm -------------------------------------------------------------------------------- /examples/Delphi/ExRSAKey.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/ExRSAKey.res -------------------------------------------------------------------------------- /examples/Delphi/ExStrin1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/ExStrin1.dfm -------------------------------------------------------------------------------- /examples/Delphi/HashCmp1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/HashCmp1.dfm -------------------------------------------------------------------------------- /examples/Delphi/RSAKeys1.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphi-pascal-archive/Pascal-RSA/HEAD/examples/Delphi/RSAKeys1.dfm -------------------------------------------------------------------------------- /examples/Delphi/DSAKeys.dpr: -------------------------------------------------------------------------------- 1 | program DSAKeys; 2 | 3 | uses 4 | Forms, 5 | DSAKeys1 in 'DSAKeys1.pas' {frmDSAKeys}, 6 | LbUtils in '..\..\LbUtils.pas'; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.CreateForm(TfrmDSAKeys, frmDSAKeys); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /examples/Delphi/ExFile.dpr: -------------------------------------------------------------------------------- 1 | program ExFile; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | ExFile1 in 'ExFile1.pas' {Form1}; 11 | 12 | 13 | begin 14 | Application.Initialize; 15 | Application.CreateForm(TForm1, Form1); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /examples/Delphi/RDLCmp.dpr: -------------------------------------------------------------------------------- 1 | program RDLCmp; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | RDLCmp1 in 'RDLCmp1.pas' {Form1}; 11 | 12 | 13 | begin 14 | Application.Initialize; 15 | Application.CreateForm(TForm1, Form1); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /examples/Delphi/RSACmp.dpr: -------------------------------------------------------------------------------- 1 | program RSACmp; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | RSACmp1 in 'RSACmp1.pas' {Form1}; 11 | 12 | 13 | begin 14 | Application.Initialize; 15 | Application.CreateForm(TForm1, Form1); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /examples/Kylix/ExFile.dpr: -------------------------------------------------------------------------------- 1 | program ExFile; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | ExFile1 in 'ExFile1.pas' {Form1}; 11 | 12 | 13 | begin 14 | Application.Initialize; 15 | Application.CreateForm(TForm1, Form1); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /examples/Kylix/RDLCmp.dpr: -------------------------------------------------------------------------------- 1 | program RDLCmp; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | RDLCmp1 in 'RDLCmp1.pas' {Form1}; 11 | 12 | 13 | begin 14 | Application.Initialize; 15 | Application.CreateForm(TForm1, Form1); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /examples/Kylix/RSACmp.dpr: -------------------------------------------------------------------------------- 1 | program RSACmp; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | RSACmp1 in 'RSACmp1.pas' {Form1}; 11 | 12 | 13 | begin 14 | Application.Initialize; 15 | Application.CreateForm(TForm1, Form1); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /examples/Delphi/ExString.dpr: -------------------------------------------------------------------------------- 1 | program ExString; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | ExStrin1 in 'ExStrin1.pas' {Form1}; 11 | 12 | 13 | begin 14 | Application.Initialize; 15 | Application.CreateForm(TForm1, Form1); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /examples/Kylix/ExString.dpr: -------------------------------------------------------------------------------- 1 | program ExString; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | ExStrin1 in 'ExStrin1.pas' {Form1}; 11 | 12 | 13 | begin 14 | Application.Initialize; 15 | Application.CreateForm(TForm1, Form1); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /examples/Delphi/DSACmp.dpr: -------------------------------------------------------------------------------- 1 | program DSACmp; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | DSACmp1 in 'DSACmp1.pas' {Form1}; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TForm1, Form1); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /examples/Delphi/ExHash.dpr: -------------------------------------------------------------------------------- 1 | program ExHash; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | ExHash1 in 'ExHash1.pas' {Form1}; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TForm1, Form1); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /examples/Delphi/RSASSA.dpr: -------------------------------------------------------------------------------- 1 | program RSASSA; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | RSASSA1 in 'RSASSA1.pas' {Form1}; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TForm1, Form1); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /examples/Kylix/DSACmp.dpr: -------------------------------------------------------------------------------- 1 | program DSACmp; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | DSACmp1 in 'DSACmp1.pas' {Form1}; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TForm1, Form1); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /examples/Kylix/ExHash.dpr: -------------------------------------------------------------------------------- 1 | program ExHash; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | ExHash1 in 'ExHash1.pas' {Form1}; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TForm1, Form1); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /examples/Kylix/RSASSA.dpr: -------------------------------------------------------------------------------- 1 | program RSASSA; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | RSASSA1 in 'RSASSA1.pas' {Form1}; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TForm1, Form1); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /examples/Delphi/HashCmp.dpr: -------------------------------------------------------------------------------- 1 | program HashCmp; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | HashCmp1 in 'HashCmp1.pas' {Form1}; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TForm1, Form1); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /examples/Kylix/HashCmp.dpr: -------------------------------------------------------------------------------- 1 | program HashCmp; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | HashCmp1 in 'HashCmp1.pas' {Form1}; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TForm1, Form1); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /examples/Kylix/ExFile.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /examples/Kylix/ExHash.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /examples/Kylix/ExRSAKey.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /examples/Kylix/ExString.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /examples/Kylix/HashCmp.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /examples/Kylix/RDLCmp.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /examples/Kylix/RSACmp.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /examples/Kylix/RSAKeys.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /examples/Kylix/RSASSA.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /packages/tplockboxd.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J+ 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /packages/tplockboxr.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J+ 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -------------------------------------------------------------------------------- /examples/Delphi/DSASig.dpr: -------------------------------------------------------------------------------- 1 | program DSASig; 2 | 3 | uses 4 | Forms, 5 | DSASig1 in 'DSASig1.pas' {frmDSASig}, 6 | DSASig2 in 'DSASig2.pas' {dlgKeySize}; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.CreateForm(TfrmDSASig, frmDSASig); 13 | Application.CreateForm(TdlgKeySize, dlgKeySize); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /examples/Kylix/ExRSAKey.dpr: -------------------------------------------------------------------------------- 1 | program ExRSAKey; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | ExRSAKe1 in 'ExRSAKe1.pas' {Form1}, 11 | LbUtils in '../../LbUtils.pas'; 12 | 13 | {$R *.res} 14 | 15 | begin 16 | Application.Initialize; 17 | Application.CreateForm(TForm1, Form1); 18 | Application.Run; 19 | end. 20 | -------------------------------------------------------------------------------- /examples/Delphi/ExRSAKey.dpr: -------------------------------------------------------------------------------- 1 | program ExRSAKey; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | ExRSAKe1 in 'ExRSAKe1.pas' {Form1}, 11 | LbUtils in '../../source/LbUtils.pas'; 12 | 13 | {$R *.res} 14 | 15 | begin 16 | Application.Initialize; 17 | Application.CreateForm(TForm1, Form1); 18 | Application.Run; 19 | end. 20 | -------------------------------------------------------------------------------- /examples/Kylix/DSACmp.conf: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -H+ 29 | -W+ 30 | -M 31 | -$M16384,1048576 32 | -K$00400000 33 | -U"../../" 34 | -O"../../" 35 | -I"../../" 36 | -R"../../" 37 | -------------------------------------------------------------------------------- /examples/Delphi/RSAKeys.dpr: -------------------------------------------------------------------------------- 1 | program RSAKeys; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | RSAKeys1 in 'RSAKeys1.pas' {Form1}, 11 | 12 | {$IFDEF WIN32} 13 | LbUtils in '..\..\LbUtils.pas'; 14 | {$ENDIF} 15 | {$IFDEF LINUX} 16 | LbUtils in '../../LbUtils.pas'; 17 | {$ENDIF} 18 | 19 | {$R *.res} 20 | 21 | begin 22 | Application.Initialize; 23 | Application.CreateForm(TForm1, Form1); 24 | Application.Run; 25 | end. 26 | -------------------------------------------------------------------------------- /examples/Kylix/RSAKeys.dpr: -------------------------------------------------------------------------------- 1 | program RSAKeys; 2 | 3 | uses 4 | {$IFDEF WIN32} 5 | Forms, 6 | {$ENDIF} 7 | {$IFDEF LINUX} 8 | QForms, 9 | {$ENDIF} 10 | RSAKeys1 in 'RSAKeys1.pas' {Form1}, 11 | 12 | {$IFDEF WIN32} 13 | LbUtils in '..\..\LbUtils.pas'; 14 | {$ENDIF} 15 | {$IFDEF LINUX} 16 | LbUtils in '../../LbUtils.pas'; 17 | {$ENDIF} 18 | 19 | {$R *.res} 20 | 21 | begin 22 | Application.Initialize; 23 | Application.CreateForm(TForm1, Form1); 24 | Application.Run; 25 | end. 26 | -------------------------------------------------------------------------------- /examples/CBuilder/DSASig2.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | 5 | #include "DSASig2.h" 6 | //--------------------------------------------------------------------------- 7 | #pragma package(smart_init) 8 | #pragma resource "*.dfm" 9 | TdlgKeySize *dlgKeySize; 10 | //--------------------------------------------------------------------------- 11 | __fastcall TdlgKeySize::TdlgKeySize(TComponent* Owner) 12 | : TForm(Owner) 13 | { 14 | } 15 | //--------------------------------------------------------------------------- 16 | -------------------------------------------------------------------------------- /examples/CBuilder/DSACmp.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("DSACmp.res"); 5 | USEFORM("DSACmp1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/ExFile.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("ExFile.res"); 5 | USEFORM("ExFile1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/ExHash.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("ExHash.res"); 5 | USEFORM("ExHash1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/RDLCmp.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("RDLCmp.res"); 5 | USEFORM("RDLCmp1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/RSACmp.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("RSACmp.res"); 5 | USEFORM("RSACmp1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/RSASSA.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("RSASSA.res"); 5 | USEFORM("RSASSA1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/ExRSAKey.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("ExRSAKey.res"); 5 | USEFORM("ExRSAKe1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/ExString.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("ExString.res"); 5 | USEFORM("ExStrin1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/HashCmp.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("HashCmp.res"); 5 | USEFORM("HashCmp1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/RSAKeys.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("RSAKeys.res"); 5 | USEFORM("RSAKeys1.cpp", Form1); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TForm1), &Form1); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/CBuilder/DSAKeys.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("DSAKeys.res"); 5 | USEFORM("DSAKeys1.cpp", frmDSAKeys); 6 | //--------------------------------------------------------------------------- 7 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 8 | { 9 | try 10 | { 11 | Application->Initialize(); 12 | Application->CreateForm(__classid(TfrmDSAKeys), &frmDSAKeys); 13 | Application->Run(); 14 | } 15 | catch (Exception &exception) 16 | { 17 | Application->ShowException(&exception); 18 | } 19 | return 0; 20 | } 21 | //--------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /examples/Delphi/DSASig2.pas: -------------------------------------------------------------------------------- 1 | unit DSASig2; 2 | 3 | interface 4 | 5 | uses 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 | StdCtrls; 8 | 9 | type 10 | TdlgKeySize = class(TForm) 11 | Label9: TLabel; 12 | cbxKeySize: TComboBox; 13 | Label8: TLabel; 14 | Label5: TLabel; 15 | cbxIterations: TComboBox; 16 | btnOK: TButton; 17 | btnCancel: TButton; 18 | procedure FormCreate(Sender: TObject); 19 | private 20 | { Private declarations } 21 | public 22 | { Public declarations } 23 | end; 24 | 25 | var 26 | dlgKeySize: TdlgKeySize; 27 | 28 | implementation 29 | 30 | {$R *.DFM} 31 | 32 | procedure TdlgKeySize.FormCreate(Sender: TObject); 33 | begin 34 | cbxKeySize.ItemIndex := 2; 35 | cbxIterations.ItemIndex := 2; 36 | end; 37 | 38 | end. 39 | -------------------------------------------------------------------------------- /examples/CBuilder/DSASig.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | USERES("DSASig.res"); 5 | USEFORM("DSASig1.cpp", frmDSASig); 6 | USEFORM("DSASig2.cpp", dlgKeySize); 7 | //--------------------------------------------------------------------------- 8 | WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 9 | { 10 | try 11 | { 12 | Application->Initialize(); 13 | Application->CreateForm(__classid(TfrmDSASig), &frmDSASig); 14 | Application->CreateForm(__classid(TdlgKeySize), &dlgKeySize); 15 | Application->Run(); 16 | } 17 | catch (Exception &exception) 18 | { 19 | Application->ShowException(&exception); 20 | } 21 | return 0; 22 | } 23 | //--------------------------------------------------------------------------- 24 | -------------------------------------------------------------------------------- /packages/buildrc: -------------------------------------------------------------------------------- 1 | PACKAGENAME=lockbox 2 | PRODUCTNAME=LockBox 3 | MAJORVERSION=2 4 | MINORVERSION=03 5 | VERBOSE=-vv 6 | BASE=/tmp/lockbox 7 | #------------------------------------------------------------------------------ 8 | # Sections to copy 9 | #------------------------------------------------------------------------------ 10 | CPDIR=Examples 11 | CPDIR=Graphics 12 | CPFILE=${A} 13 | #------------------------------------------------------------------------------ 14 | # delete section : 15 | #------------------------------------------------------------------------------ 16 | TYPE=${A}~${A} 17 | TYPE=${A}.dcu 18 | TYPE=${A}.dpu 19 | TYPE=${A}.dcp 20 | TYPE=${A}.kof 21 | TYPE=${A}.scc 22 | TYPE=${A}.trl 23 | TYPE=${A}.gz 24 | TYPE=tmp 25 | TYPE=convertdos2unix 26 | FILE=nohup.out 27 | FILE=clear 28 | FILE=Changes.txt 29 | FILE=CreateRPM.sh 30 | FILE=CreateRPMs.sh 31 | FILE=CreateRPM.tmp.sh 32 | FILE=CreateTarBall.sh 33 | FILE=buildrc 34 | FILE=ExtraDeletes 35 | FILE=tmp 36 | DIR=dunit 37 | DIR=Help 38 | DIR=tmp 39 | -------------------------------------------------------------------------------- /examples/CBuilder/DSASig2.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef DSASig2H 3 | #define DSASig2H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | //--------------------------------------------------------------------------- 10 | class TdlgKeySize : public TForm 11 | { 12 | __published: // IDE-managed Components 13 | TLabel *Label9; 14 | TLabel *Label8; 15 | TLabel *Label5; 16 | TComboBox *cbxKeySize; 17 | TComboBox *cbxIterations; 18 | TButton *btnOK; 19 | TButton *btnCancel; 20 | private: // User declarations 21 | public: // User declarations 22 | __fastcall TdlgKeySize(TComponent* Owner); 23 | }; 24 | //--------------------------------------------------------------------------- 25 | extern PACKAGE TdlgKeySize *dlgKeySize; 26 | //--------------------------------------------------------------------------- 27 | #endif 28 | -------------------------------------------------------------------------------- /examples/CBuilder/ExHash1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef ExHash1H 3 | #define ExHash1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | //--------------------------------------------------------------------------- 13 | class TForm1 : public TForm 14 | { 15 | __published: // IDE-managed Components 16 | TLabel *Label1; 17 | TLabel *Label2; 18 | TEdit *edtDigest; 19 | TEdit *edtMessage; 20 | TRadioGroup *rgHashMethod; 21 | TButton *btnGo; 22 | void __fastcall btnGoClick(TObject *Sender); 23 | private: // User declarations 24 | public: // User declarations 25 | __fastcall TForm1(TComponent* Owner); 26 | }; 27 | //--------------------------------------------------------------------------- 28 | extern PACKAGE TForm1 *Form1; 29 | //--------------------------------------------------------------------------- 30 | #endif 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /examples/CBuilder/HashCmp1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef HashCmp1H 3 | #define HashCmp1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "LbCipher.hpp" 10 | #include "LbClass.hpp" 11 | #include "LbUtils.hpp" 12 | #include 13 | #include 14 | //--------------------------------------------------------------------------- 15 | class TForm1 : public TForm 16 | { 17 | __published: // IDE-managed Components 18 | TButton *btnHashFile; 19 | TEdit *edtHash; 20 | TRadioGroup *rgHashMethod; 21 | TButton *btnHashString; 22 | TLbMD5 *LbMD51; 23 | TLbSHA1 *LbSHA11; 24 | TOpenDialog *OpenDialog1; 25 | void __fastcall btnHashFileClick(TObject *Sender); 26 | void __fastcall btnHashStringClick(TObject *Sender); 27 | private: // User declarations 28 | public: // User declarations 29 | __fastcall TForm1(TComponent* Owner); 30 | }; 31 | //--------------------------------------------------------------------------- 32 | extern PACKAGE TForm1 *Form1; 33 | //--------------------------------------------------------------------------- 34 | #endif 35 | -------------------------------------------------------------------------------- /examples/CBuilder/ExStrin1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef ExStrin1H 3 | #define ExStrin1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | //--------------------------------------------------------------------------- 12 | class TForm1 : public TForm 13 | { 14 | __published: // IDE-managed Components 15 | TLabel *Label4; 16 | TLabel *Label5; 17 | TLabel *Label7; 18 | TLabel *Label6; 19 | TLabel *Label1; 20 | TButton *btnEncrypt; 21 | TButton *btnDecrypt; 22 | TComboBox *cbxCipher; 23 | TMemo *mmoPlainText1; 24 | TMemo *mmoCipherText; 25 | TMemo *mmoPlainText2; 26 | TEdit *edtPassphrase; 27 | void __fastcall FormCreate(TObject *Sender); 28 | void __fastcall btnEncryptClick(TObject *Sender); 29 | void __fastcall btnDecryptClick(TObject *Sender); 30 | private: // User declarations 31 | public: // User declarations 32 | __fastcall TForm1(TComponent* Owner); 33 | }; 34 | //--------------------------------------------------------------------------- 35 | extern PACKAGE TForm1 *Form1; 36 | //--------------------------------------------------------------------------- 37 | #endif 38 | -------------------------------------------------------------------------------- /source/LbKeyEd2.pas: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | {*********************************************************} 26 | {* LBKEYED2.PAS 2.07 *} 27 | {* Copyright (c) 2002 TurboPower Software Co *} 28 | {* All rights reserved. *} 29 | {*********************************************************} 30 | 31 | {$I LockBox.inc} 32 | {$UNDEF UsingCLX} 33 | unit LbKeyEd2; 34 | {$R *.dfm} 35 | {$I LbKeyEd2.inc} 36 | 37 | -------------------------------------------------------------------------------- /source/LbQKeyEd2.pas: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | {*********************************************************} 26 | {* LBQKEYED2.PAS 2.06 *} 27 | {* Copyright (c) 2002 TurboPower Software Co *} 28 | {* All rights reserved. *} 29 | {*********************************************************} 30 | 31 | {$I LockBox.inc} 32 | {$DEFINE UsingCLX} 33 | unit LbQKeyEd2; 34 | {$R *.xfm} 35 | {$I LbKeyEd2.inc} 36 | 37 | -------------------------------------------------------------------------------- /examples/CBuilder/ExAll.bpg: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | VERSION = BWS.01 3 | #------------------------------------------------------------------------------ 4 | !ifndef ROOT 5 | ROOT = $(MAKEDIR)\.. 6 | !endif 7 | #------------------------------------------------------------------------------ 8 | MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** 9 | DCC = $(ROOT)\bin\dcc32.exe $** 10 | BRCC = $(ROOT)\bin\brcc32.exe $** 11 | #------------------------------------------------------------------------------ 12 | PROJECTS = DSACmp ExFile ExHash ExRSAKey ExString HashCmp RDLCmp RSACmp RSAKeys \ 13 | RSASSA DSAKeys DSASig 14 | #------------------------------------------------------------------------------ 15 | default: $(PROJECTS) 16 | #------------------------------------------------------------------------------ 17 | 18 | DSACmp: DSACmp.bpr 19 | $(MAKE) 20 | 21 | ExFile: ExFile.bpr 22 | $(MAKE) 23 | 24 | ExHash: ExHash.bpr 25 | $(MAKE) 26 | 27 | ExRSAKey: ExRSAKey.bpr 28 | $(MAKE) 29 | 30 | ExString: ExString.bpr 31 | $(MAKE) 32 | 33 | HashCmp: HashCmp.bpr 34 | $(MAKE) 35 | 36 | RDLCmp: RDLCmp.bpr 37 | $(MAKE) 38 | 39 | RSACmp: RSACmp.bpr 40 | $(MAKE) 41 | 42 | RSAKeys: RSAKeys.bpr 43 | $(MAKE) 44 | 45 | RSASSA: RSASSA.bpr 46 | $(MAKE) 47 | 48 | DSAKeys: DSAKeys.bpr 49 | $(MAKE) 50 | 51 | DSASig: DSASig.bpr 52 | $(MAKE) 53 | 54 | 55 | -------------------------------------------------------------------------------- /packages/Makefile: -------------------------------------------------------------------------------- 1 | all : main 2 | 3 | KYLIX=/usr/local/kylix 4 | LIBPATH1=${KYLIX}/lib 5 | LIBPATH2=${PWD} 6 | LIB1=/lib 7 | LIB2=/usr/lib 8 | LIB3=${KYLIX}/bin 9 | DCC=${KYLIX}/bin/dcc 10 | EXEPATH=${PWD} 11 | APP=lockbox 12 | BINPATH=${KYLIX}/bin/ 13 | 14 | clean : 15 | find . -type f -iname "*~*" -exec rm {} \; 16 | find . -type f -iname "*.dcu" -exec rm {} \; 17 | find . -type f -iname "*.dpu" -exec rm {} \; 18 | find . -type f -iname "*.dcp" -exec rm {} \; 19 | find . -type f -iname "*.kof" -exec rm {} \; 20 | find . -type f -perm -755 -exec rm {} \; 21 | 22 | install : 23 | # move and symbolic link them 24 | cp bpltp${APP}${VERSION}r.so ${BINPATH}bpltp-${APP}${VERSION}-r.so.6.0 25 | cp bpltp${APP}${VERSION}d.so ${BINPATH}bpltp-${APP}${VERSION}-d.so.6.0 26 | ln -fs ${BINPATH}bpltp-${APP}${VERSION}-d.so.6.0 ${BINPATH}bpltp${APP}${VERSION}d.so 27 | ln -fs ${BINPATH}bpltp-${APP}${VERSION}-r.so.6.0 ${BINPATH}bpltp${APP}${VERSION}r.so 28 | 29 | rpminstall : 30 | # move them 31 | mv bpltp${APP}${VERSION}r.so ../packages/bpltp${APP}${VERSION}r.so 32 | mv bpltp${APP}${VERSION}d.so ../packages/bpltp${APP}${VERSION}d.so 33 | 34 | main : 35 | # compile the libraries 36 | ${DCC} -B -W -H -Q -O${LIB1} -O${LIB2} -O${LIB3} -U${LIBPATH1} -U${LIBPATH2} -E${EXEPATH} tp${APP}${VERSION}r.dpk 37 | ${DCC} -B -W -H -Q -O${LIB1} -O${LIB2} -O${LIB3} -U${LIBPATH1} -U${LIBPATH2} -E${EXEPATH} tp${APP}${VERSION}d.dpk 38 | 39 | -------------------------------------------------------------------------------- /source/LbQKeyEd1.pas: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | {*********************************************************} 26 | {* LBQKEYED1.PAS 2.06 *} 27 | {* Copyright (c) 2002 TurboPower Software Co *} 28 | {* All rights reserved. *} 29 | {* CLX header *} 30 | {*********************************************************} 31 | 32 | {$I LockBox.inc} 33 | {$DEFINE UsingClx} 34 | 35 | unit LbQKeyEd1; 36 | {$R *.xfm} 37 | {$I LbKeyEd1.inc} 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /examples/Delphi/ExAll.bpg: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | VERSION = BWS.01 3 | #------------------------------------------------------------------------------ 4 | !ifndef ROOT 5 | ROOT = $(MAKEDIR)\.. 6 | !endif 7 | #------------------------------------------------------------------------------ 8 | MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** 9 | DCC = $(ROOT)\bin\dcc32.exe $** 10 | BRCC = $(ROOT)\bin\brcc32.exe $** 11 | #------------------------------------------------------------------------------ 12 | PROJECTS = DSACmp.exe ExFile.exe ExHash.exe ExRSAKey.exe ExString.exe \ 13 | HashCmp.exe RDLCmp.exe RSACmp.exe RSAKeys.exe RSASSA.exe DSAKeys.exe DSASig.exe 14 | #------------------------------------------------------------------------------ 15 | default: $(PROJECTS) 16 | #------------------------------------------------------------------------------ 17 | 18 | DSACmp.exe: DSACmp.dpr 19 | $(DCC) 20 | 21 | ExFile.exe: ExFile.dpr 22 | $(DCC) 23 | 24 | ExHash.exe: ExHash.dpr 25 | $(DCC) 26 | 27 | ExRSAKey.exe: ExRSAKey.dpr 28 | $(DCC) 29 | 30 | ExString.exe: ExString.dpr 31 | $(DCC) 32 | 33 | HashCmp.exe: HashCmp.dpr 34 | $(DCC) 35 | 36 | RDLCmp.exe: RDLCmp.dpr 37 | $(DCC) 38 | 39 | RSACmp.exe: RSACmp.dpr 40 | $(DCC) 41 | 42 | RSAKeys.exe: RSAKeys.dpr 43 | $(DCC) 44 | 45 | RSASSA.exe: RSASSA.dpr 46 | $(DCC) 47 | 48 | DSAKeys.exe: DSAKeys.dpr 49 | $(DCC) 50 | 51 | DSASig.exe: DSASig.dpr 52 | $(DCC) 53 | 54 | 55 | -------------------------------------------------------------------------------- /source/LbKeyEd1.pas: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | {*********************************************************} 26 | {* LBKEYED1.PAS 2.07 *} 27 | {* Copyright (c) 2002 TurboPower Software Co *} 28 | {* All rights reserved. *} 29 | {* VCL header *} 30 | {*********************************************************} 31 | 32 | {$UNDEF UsingClx} 33 | {$I LockBox.inc} 34 | 35 | unit LbKeyEd1; 36 | {-TKey128 generation dialog} 37 | 38 | {$R *.dfm} 39 | 40 | {$I LbKeyEd1.inc} 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /packages/L207_r61.cpp: -------------------------------------------------------------------------------- 1 | // ***** BEGIN LICENSE BLOCK ***** 2 | // * Version: MPL 1.1 3 | // * 4 | // * The contents of this file are subject to the Mozilla Public License Version 5 | // * 1.1 (the "License"); you may not use this file except in compliance with 6 | // * the License. You may obtain a copy of the License at 7 | // * http://www.mozilla.org/MPL/ 8 | // * 9 | // * Software distributed under the License is distributed on an "AS IS" basis, 10 | // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | // * for the specific language governing rights and limitations under the 12 | // * License. 13 | // * 14 | // * The Original Code is TurboPower LockBox 15 | // * 16 | // * The Initial Developer of the Original Code is 17 | // * TurboPower Software 18 | // * 19 | // * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | // * the Initial Developer. All Rights Reserved. 21 | // * 22 | // * Contributor(s): 23 | // * 24 | // * ***** END LICENSE BLOCK ***** 25 | //--------------------------------------------------------------------------- 26 | #include 27 | #pragma hdrstop 28 | #pragma package(smart_init) 29 | //--------------------------------------------------------------------------- 30 | // Package source. 31 | //--------------------------------------------------------------------------- 32 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 33 | { 34 | return 1; 35 | } 36 | //--------------------------------------------------------------------------- 37 | -------------------------------------------------------------------------------- /packages/L207vc61.cpp: -------------------------------------------------------------------------------- 1 | // ***** BEGIN LICENSE BLOCK ***** 2 | // * Version: MPL 1.1 3 | // * 4 | // * The contents of this file are subject to the Mozilla Public License Version 5 | // * 1.1 (the "License"); you may not use this file except in compliance with 6 | // * the License. You may obtain a copy of the License at 7 | // * http://www.mozilla.org/MPL/ 8 | // * 9 | // * Software distributed under the License is distributed on an "AS IS" basis, 10 | // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | // * for the specific language governing rights and limitations under the 12 | // * License. 13 | // * 14 | // * The Original Code is TurboPower LockBox 15 | // * 16 | // * The Initial Developer of the Original Code is 17 | // * TurboPower Software 18 | // * 19 | // * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | // * the Initial Developer. All Rights Reserved. 21 | // * 22 | // * Contributor(s): 23 | // * 24 | // * ***** END LICENSE BLOCK ***** 25 | //--------------------------------------------------------------------------- 26 | #include 27 | #pragma hdrstop 28 | #pragma package(smart_init) 29 | //--------------------------------------------------------------------------- 30 | // Package source. 31 | //--------------------------------------------------------------------------- 32 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 33 | { 34 | return 1; 35 | } 36 | //--------------------------------------------------------------------------- 37 | -------------------------------------------------------------------------------- /examples/CBuilder/ExFile1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef ExFile1H 3 | #define ExFile1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | //--------------------------------------------------------------------------- 14 | class TForm1 : public TForm 15 | { 16 | __published: // IDE-managed Components 17 | TLabel *Label4; 18 | TSpeedButton *SpeedButton1; 19 | TSpeedButton *SpeedButton2; 20 | TLabel *Label1; 21 | TLabel *Label2; 22 | TLabel *Label3; 23 | TButton *btnGo; 24 | TComboBox *cbxCipher; 25 | TEdit *edtInFile; 26 | TEdit *edtOutFile; 27 | TCheckBox *chkEncrypt; 28 | TEdit *edtPassphrase; 29 | TOpenDialog *OpenDialog1; 30 | TSaveDialog *SaveDialog1; 31 | void __fastcall FormCreate(TObject *Sender); 32 | void __fastcall btnGoClick(TObject *Sender); 33 | void __fastcall SpeedButton1Click(TObject *Sender); 34 | void __fastcall SpeedButton2Click(TObject *Sender); 35 | private: // User declarations 36 | public: // User declarations 37 | __fastcall TForm1(TComponent* Owner); 38 | }; 39 | //--------------------------------------------------------------------------- 40 | extern PACKAGE TForm1 *Form1; 41 | //--------------------------------------------------------------------------- 42 | #endif 43 | -------------------------------------------------------------------------------- /examples/CBuilder/RDLCmp1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef RDLCmp1H 3 | #define RDLCmp1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "LbCipher.hpp" 10 | #include "LbClass.hpp" 11 | //--------------------------------------------------------------------------- 12 | class TForm1 : public TForm 13 | { 14 | __published: // IDE-managed Components 15 | TLabel *Label4; 16 | TLabel *Label5; 17 | TLabel *Label7; 18 | TLabel *Label6; 19 | TLabel *Label1; 20 | TLabel *Label2; 21 | TButton *btnEncrypt; 22 | TButton *btnDecrypt; 23 | TComboBox *cbxCipherMode; 24 | TMemo *mmoPlainText1; 25 | TMemo *mmoCipherText; 26 | TMemo *mmoPlainText2; 27 | TEdit *edtPassphrase; 28 | TComboBox *cbxKeySize; 29 | TLbRijndael *LbRijndael1; 30 | void __fastcall FormCreate(TObject *Sender); 31 | void __fastcall btnEncryptClick(TObject *Sender); 32 | void __fastcall btnDecryptClick(TObject *Sender); 33 | void __fastcall cbxCipherModeChange(TObject *Sender); 34 | void __fastcall cbxKeySizeChange(TObject *Sender); 35 | private: // User declarations 36 | public: // User declarations 37 | __fastcall TForm1(TComponent* Owner); 38 | }; 39 | //--------------------------------------------------------------------------- 40 | extern PACKAGE TForm1 *Form1; 41 | //--------------------------------------------------------------------------- 42 | #endif 43 | -------------------------------------------------------------------------------- /examples/CBuilder/RSACmp1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef RSACmp1H 3 | #define RSACmp1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "LbAsym.hpp" 10 | #include "LbCipher.hpp" 11 | #include "LbClass.hpp" 12 | #include "LbRSA.hpp" 13 | #include 14 | #include 15 | //--------------------------------------------------------------------------- 16 | class TForm1 : public TForm 17 | { 18 | __published: // IDE-managed Components 19 | TLabel *Label5; 20 | TLabel *Label7; 21 | TLabel *Label6; 22 | TButton *btnEncrypt; 23 | TButton *btnDecrypt; 24 | TMemo *mmoPlainText1; 25 | TMemo *mmoCipherText; 26 | TMemo *mmoPlainText2; 27 | TButton *btnGenKeys; 28 | TStatusBar *StatusBar1; 29 | TLbRSA *LbRSA1; 30 | TLabel *Label1; 31 | TComboBox *cbxKeySize; 32 | void __fastcall btnEncryptClick(TObject *Sender); 33 | void __fastcall btnDecryptClick(TObject *Sender); 34 | void __fastcall btnGenKeysClick(TObject *Sender); 35 | 36 | void __fastcall FormCreate(TObject *Sender); 37 | void __fastcall cbxKeySizeChange(TObject *Sender); 38 | private: // User declarations 39 | public: // User declarations 40 | __fastcall TForm1(TComponent* Owner); 41 | }; 42 | //--------------------------------------------------------------------------- 43 | extern PACKAGE TForm1 *Form1; 44 | //--------------------------------------------------------------------------- 45 | #endif 46 | -------------------------------------------------------------------------------- /examples/CBuilder/ExHash1.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | 5 | #include "ExHash1.h" 6 | #pragma link "LbCipher.obj" 7 | #pragma link "LbUtils.obj" 8 | //--------------------------------------------------------------------------- 9 | #pragma package(smart_init) 10 | #pragma resource "*.dfm" 11 | TForm1 *Form1; 12 | 13 | enum THashMethod {hmMD5, hmSHA1, hmLMD, hmELF}; 14 | 15 | TMD5Digest MD5Digest; 16 | TSHA1Digest SHA1Digest; 17 | int ELFDigest; 18 | int LMDDigest; 19 | 20 | 21 | //--------------------------------------------------------------------------- 22 | __fastcall TForm1::TForm1(TComponent* Owner) 23 | : TForm(Owner) 24 | { 25 | } 26 | //--------------------------------------------------------------------------- 27 | void __fastcall TForm1::btnGoClick(TObject *Sender) 28 | { 29 | switch ((THashMethod) rgHashMethod->ItemIndex) { 30 | case hmMD5 : StringHashMD5(MD5Digest, edtMessage->Text); 31 | edtDigest->Text = BufferToHex(MD5Digest, sizeof(MD5Digest)); 32 | break; 33 | case hmSHA1 : StringHashSHA1(SHA1Digest, edtMessage->Text); 34 | edtDigest->Text = BufferToHex(SHA1Digest, sizeof(SHA1Digest)); 35 | break; 36 | case hmLMD : StringHashLMD(&LMDDigest, sizeof(LMDDigest), edtMessage->Text); 37 | edtDigest->Text = BufferToHex(&LMDDigest, sizeof(LMDDigest)); 38 | break; 39 | case hmELF : StringHashELF(ELFDigest, edtMessage->Text); 40 | edtDigest->Text = BufferToHex(&ELFDigest, sizeof(ELFDigest)); 41 | break; 42 | } 43 | } 44 | //--------------------------------------------------------------------------- 45 | 46 | -------------------------------------------------------------------------------- /packages/l207_d30.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207_d30; 26 | 27 | {$R *.RES} 28 | {$R '..\source\LbDesign.dcr'} 29 | {$ALIGN ON} 30 | {$ASSERTIONS OFF} 31 | {$BOOLEVAL OFF} 32 | {$DEBUGINFO OFF} 33 | {$EXTENDEDSYNTAX ON} 34 | {$IMPORTEDDATA ON} 35 | {$IOCHECKS ON} 36 | {$LOCALSYMBOLS OFF} 37 | {$LONGSTRINGS ON} 38 | {$OPENSTRINGS ON} 39 | {$OPTIMIZATION ON} 40 | {$OVERFLOWCHECKS OFF} 41 | {$RANGECHECKS OFF} 42 | {$REFERENCEINFO OFF} 43 | {$SAFEDIVIDE OFF} 44 | {$STACKFRAMES OFF} 45 | {$TYPEDADDRESS OFF} 46 | {$VARSTRINGCHECKS ON} 47 | {$WRITEABLECONST ON} 48 | {$MINENUMSIZE 1} 49 | {$IMAGEBASE $00400000} 50 | {$DESCRIPTION 'TurboPower LockBox 2.07 Design-time package - VCL30'} 51 | {$DESIGNONLY} 52 | {$IMPLICITBUILD ON} 53 | 54 | requires 55 | vcl30, 56 | vclx30, 57 | L207_r30; 58 | 59 | contains 60 | LbDesign, 61 | LbKeyEd1, 62 | LbKeyEd2; 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /packages/L207vd61.cpp: -------------------------------------------------------------------------------- 1 | // ***** BEGIN LICENSE BLOCK ***** 2 | // * Version: MPL 1.1 3 | // * 4 | // * The contents of this file are subject to the Mozilla Public License Version 5 | // * 1.1 (the "License"); you may not use this file except in compliance with 6 | // * the License. You may obtain a copy of the License at 7 | // * http://www.mozilla.org/MPL/ 8 | // * 9 | // * Software distributed under the License is distributed on an "AS IS" basis, 10 | // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | // * for the specific language governing rights and limitations under the 12 | // * License. 13 | // * 14 | // * The Original Code is TurboPower LockBox 15 | // * 16 | // * The Initial Developer of the Original Code is 17 | // * TurboPower Software 18 | // * 19 | // * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | // * the Initial Developer. All Rights Reserved. 21 | // * 22 | // * Contributor(s): 23 | // * 24 | // * ***** END LICENSE BLOCK ***** 25 | //--------------------------------------------------------------------------- 26 | #include 27 | #pragma hdrstop 28 | USEFORMNS("..\source\LbDesign.pas", Lbdesign, LbAboutForm); 29 | USEFORMNS("..\source\LbKeyEd2.pas", Lbkeyed2, frmRSAKeys); 30 | USEFORMNS("..\source\LbKeyEd1.pas", Lbkeyed1, frmSymmetricKey); 31 | //--------------------------------------------------------------------------- 32 | #pragma package(smart_init) 33 | //--------------------------------------------------------------------------- 34 | // Package source. 35 | //--------------------------------------------------------------------------- 36 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 37 | { 38 | return 1; 39 | } 40 | //--------------------------------------------------------------------------- 41 | -------------------------------------------------------------------------------- /packages/L207_d40.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207_d40; 26 | 27 | {$R *.RES} 28 | {$R '..\source\LbDesign.dcr'} 29 | {$ALIGN ON} 30 | {$ASSERTIONS ON} 31 | {$BOOLEVAL OFF} 32 | {$DEBUGINFO OFF} 33 | {$EXTENDEDSYNTAX ON} 34 | {$IMPORTEDDATA ON} 35 | {$IOCHECKS ON} 36 | {$LOCALSYMBOLS OFF} 37 | {$LONGSTRINGS ON} 38 | {$OPENSTRINGS ON} 39 | {$OPTIMIZATION ON} 40 | {$OVERFLOWCHECKS OFF} 41 | {$RANGECHECKS OFF} 42 | {$REFERENCEINFO OFF} 43 | {$SAFEDIVIDE OFF} 44 | {$STACKFRAMES OFF} 45 | {$TYPEDADDRESS OFF} 46 | {$VARSTRINGCHECKS ON} 47 | {$WRITEABLECONST ON} 48 | {$MINENUMSIZE 1} 49 | {$IMAGEBASE $00400000} 50 | {$DESCRIPTION 'TurboPower LockBox 2.07 Design-time package - VCL40'} 51 | {$DESIGNONLY} 52 | {$IMPLICITBUILD ON} 53 | 54 | requires 55 | vcl40, 56 | vclx40, 57 | L207_r40; 58 | 59 | contains 60 | LbDesign in '..\source\LbDesign.pas', 61 | LbKeyEd1 in '..\source\LbKeyEd1.pas', 62 | LbKeyEd2 in '..\source\LbKeyEd2.pas'; 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /examples/CBuilder/RSASSA1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef RSASSA1H 3 | #define RSASSA1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "LbAsym.hpp" 10 | #include "LbCipher.hpp" 11 | #include "LbClass.hpp" 12 | #include "LbRSA.hpp" 13 | #include "LbUtils.hpp" 14 | #include 15 | #include 16 | #include 17 | //--------------------------------------------------------------------------- 18 | class TForm1 : public TForm 19 | { 20 | __published: // IDE-managed Components 21 | TLabel *Label1; 22 | TLabel *Label4; 23 | TLabel *Label3; 24 | TStatusBar *StatusBar1; 25 | TMemo *mmoSignature; 26 | TGroupBox *GroupBox1; 27 | TLabel *Label2; 28 | TComboBox *cbxKeySize; 29 | TButton *btnGenKeys; 30 | TEdit *edtMsg; 31 | TButton *btnSign; 32 | TButton *btnVerify; 33 | TComboBox *cbxHashMethod; 34 | TLbRSASSA *LbRSASSA1;void __fastcall FormCreate(TObject *Sender); 35 | void __fastcall btnGenKeysClick(TObject *Sender); 36 | void __fastcall cbxKeySizeChange(TObject *Sender); 37 | void __fastcall cbxHashMethodChange(TObject *Sender); 38 | void __fastcall LbRSASSA1GetSignature(TObject *Sender, 39 | TRSASignatureBlock &Sig); 40 | void __fastcall btnSignClick(TObject *Sender); 41 | void __fastcall btnVerifyClick(TObject *Sender); 42 | private: // User declarations 43 | public: // User declarations 44 | __fastcall TForm1(TComponent* Owner); 45 | }; 46 | //--------------------------------------------------------------------------- 47 | extern PACKAGE TForm1 *Form1; 48 | //--------------------------------------------------------------------------- 49 | #endif 50 | -------------------------------------------------------------------------------- /packages/l207_r30.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207_r30; 26 | 27 | {$R *.RES} 28 | {$ALIGN ON} 29 | {$ASSERTIONS ON} 30 | {$BOOLEVAL OFF} 31 | {$DEBUGINFO OFF} 32 | {$EXTENDEDSYNTAX ON} 33 | {$IMPORTEDDATA ON} 34 | {$IOCHECKS ON} 35 | {$LOCALSYMBOLS OFF} 36 | {$LONGSTRINGS ON} 37 | {$OPENSTRINGS ON} 38 | {$OPTIMIZATION ON} 39 | {$OVERFLOWCHECKS OFF} 40 | {$RANGECHECKS OFF} 41 | {$REFERENCEINFO OFF} 42 | {$SAFEDIVIDE OFF} 43 | {$STACKFRAMES OFF} 44 | {$TYPEDADDRESS OFF} 45 | {$VARSTRINGCHECKS ON} 46 | {$WRITEABLECONST ON} 47 | {$MINENUMSIZE 1} 48 | {$IMAGEBASE $00400000} 49 | {$DESCRIPTION 'TurboPower LockBox 2.07 Run-time package - VCL30'} 50 | {$RUNONLY} 51 | {$IMPLICITBUILD ON} 52 | 53 | requires 54 | vcl30, 55 | vclx30; 56 | 57 | contains 58 | LbUtils, 59 | LbBigInt, 60 | LBCIPHER, 61 | LbClass, 62 | LbConst, 63 | LbDSA, 64 | LBPROC, 65 | LbRandom, 66 | LbRSA, 67 | LbString, 68 | LbAsym; 69 | 70 | {$R *.RES} 71 | 72 | end. 73 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | # C++ object files produced when C/C++ Output file generation is configured. 25 | # Uncomment this if you are not using external objects (zlib library for example). 26 | #*.obj 27 | # 28 | 29 | # Delphi compiler-generated binaries (safe to delete) 30 | *.exe 31 | *.dll 32 | *.bpl 33 | *.bpi 34 | *.dcp 35 | *.so 36 | *.apk 37 | *.drc 38 | *.map 39 | *.dres 40 | *.rsm 41 | *.tds 42 | *.dcu 43 | *.lib 44 | *.a 45 | *.o 46 | *.ocx 47 | 48 | # Delphi autogenerated files (duplicated info) 49 | *.cfg 50 | *.hpp 51 | *Resource.rc 52 | 53 | # Delphi local files (user-specific info) 54 | *.local 55 | *.identcache 56 | *.projdata 57 | *.tvsconfig 58 | *.dsk 59 | 60 | # Delphi history and backups 61 | __history/ 62 | __recovery/ 63 | *.~* 64 | 65 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 66 | *.stat 67 | -------------------------------------------------------------------------------- /packages/L207_d50.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207_d50; 26 | 27 | {$R *.RES} 28 | {$R '..\source\LbDesign.dcr'} 29 | {$ALIGN ON} 30 | {$ASSERTIONS OFF} 31 | {$BOOLEVAL OFF} 32 | {$DEBUGINFO OFF} 33 | {$EXTENDEDSYNTAX ON} 34 | {$IMPORTEDDATA ON} 35 | {$IOCHECKS ON} 36 | {$LOCALSYMBOLS OFF} 37 | {$LONGSTRINGS ON} 38 | {$OPENSTRINGS ON} 39 | {$OPTIMIZATION ON} 40 | {$OVERFLOWCHECKS OFF} 41 | {$RANGECHECKS OFF} 42 | {$REFERENCEINFO OFF} 43 | {$SAFEDIVIDE OFF} 44 | {$STACKFRAMES OFF} 45 | {$TYPEDADDRESS OFF} 46 | {$VARSTRINGCHECKS ON} 47 | {$WRITEABLECONST ON} 48 | {$MINENUMSIZE 1} 49 | {$IMAGEBASE $400000} 50 | {$DESCRIPTION 'TurboPower LockBox 2.07 Design-time package - VCL50'} 51 | {$DESIGNONLY} 52 | {$IMPLICITBUILD ON} 53 | 54 | requires 55 | vcl50, 56 | vclx50, 57 | L207_r50; 58 | 59 | contains 60 | LbDesign in '..\source\LbDesign.pas', 61 | LbKeyEd1 in '..\source\LbKeyEd1.pas' {frmSymmetricKey}, 62 | LbKeyEd2 in '..\source\LbKeyEd2.pas' {frmRSAKeys}; 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /packages/L207vd60.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207vd60; 26 | 27 | {$R *.res} 28 | {$R '..\source\LbDesign.dcr'} 29 | {$ALIGN 8} 30 | {$ASSERTIONS OFF} 31 | {$BOOLEVAL OFF} 32 | {$DEBUGINFO OFF} 33 | {$EXTENDEDSYNTAX ON} 34 | {$IMPORTEDDATA ON} 35 | {$IOCHECKS ON} 36 | {$LOCALSYMBOLS OFF} 37 | {$LONGSTRINGS ON} 38 | {$OPENSTRINGS ON} 39 | {$OPTIMIZATION ON} 40 | {$OVERFLOWCHECKS OFF} 41 | {$RANGECHECKS OFF} 42 | {$REFERENCEINFO OFF} 43 | {$SAFEDIVIDE OFF} 44 | {$STACKFRAMES OFF} 45 | {$TYPEDADDRESS OFF} 46 | {$VARSTRINGCHECKS ON} 47 | {$WRITEABLECONST ON} 48 | {$MINENUMSIZE 1} 49 | {$IMAGEBASE $400000} 50 | {$DESCRIPTION 'TurboPower LockBox 2.07 Design-time package - VCL60'} 51 | {$DESIGNONLY} 52 | {$IMPLICITBUILD ON} 53 | 54 | requires 55 | vcl, 56 | designide, 57 | vclx, 58 | L207_r60; 59 | 60 | contains 61 | LbDesign in '..\source\LbDesign.pas', 62 | LbKeyEd1 in '..\source\LbKeyEd1.pas' {frmSymmetricKey}, 63 | LbKeyEd2 in '..\source\LbKeyEd2.pas' {frmRSAKeys}; 64 | 65 | end. 66 | -------------------------------------------------------------------------------- /packages/L207vd70.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207vd70; 26 | 27 | {$R *.res} 28 | {$R '..\source\LbDesign.dcr'} 29 | {$ALIGN 8} 30 | {$ASSERTIONS OFF} 31 | {$BOOLEVAL OFF} 32 | {$DEBUGINFO OFF} 33 | {$EXTENDEDSYNTAX ON} 34 | {$IMPORTEDDATA ON} 35 | {$IOCHECKS ON} 36 | {$LOCALSYMBOLS OFF} 37 | {$LONGSTRINGS ON} 38 | {$OPENSTRINGS ON} 39 | {$OPTIMIZATION ON} 40 | {$OVERFLOWCHECKS OFF} 41 | {$RANGECHECKS OFF} 42 | {$REFERENCEINFO OFF} 43 | {$SAFEDIVIDE OFF} 44 | {$STACKFRAMES OFF} 45 | {$TYPEDADDRESS OFF} 46 | {$VARSTRINGCHECKS ON} 47 | {$WRITEABLECONST ON} 48 | {$MINENUMSIZE 1} 49 | {$IMAGEBASE $400000} 50 | {$DESCRIPTION 'TurboPower LockBox 2.07 Design-time package - VCL60'} 51 | {$DESIGNONLY} 52 | {$IMPLICITBUILD ON} 53 | 54 | requires 55 | vcl, 56 | designide, 57 | vclx, 58 | L207_r70; 59 | 60 | contains 61 | LbDesign in '..\source\LbDesign.pas', 62 | LbKeyEd1 in '..\source\LbKeyEd1.pas' {frmSymmetricKey}, 63 | LbKeyEd2 in '..\source\LbKeyEd2.pas' {frmRSAKeys}; 64 | 65 | end. 66 | -------------------------------------------------------------------------------- /packages/tplockboxd.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package tplockboxd; 26 | 27 | {$R *.res} 28 | {$R 'LbDesign.dcr'} 29 | {$ALIGN 8} 30 | {$ASSERTIONS ON} 31 | {$BOOLEVAL OFF} 32 | {$DEBUGINFO ON} 33 | {$EXTENDEDSYNTAX ON} 34 | {$IMPORTEDDATA ON} 35 | {$IOCHECKS ON} 36 | {$LOCALSYMBOLS ON} 37 | {$LONGSTRINGS ON} 38 | {$OPENSTRINGS ON} 39 | {$OPTIMIZATION ON} 40 | {$OVERFLOWCHECKS OFF} 41 | {$RANGECHECKS OFF} 42 | {$REFERENCEINFO ON} 43 | {$SAFEDIVIDE OFF} 44 | {$STACKFRAMES OFF} 45 | {$TYPEDADDRESS OFF} 46 | {$VARSTRINGCHECKS ON} 47 | {$WRITEABLECONST ON} 48 | {$MINENUMSIZE 1} 49 | {$IMAGEBASE $400000} 50 | {$DESCRIPTION 'LockBox XX Components'} 51 | {$DESIGNONLY} 52 | {$IMPLICITBUILD ON} 53 | 54 | requires 55 | visualclx, 56 | baseclx, 57 | dataclx, 58 | designide, 59 | tplockboxr; 60 | 61 | contains 62 | LbQDesign in 'LbQDesign.pas', 63 | LbQKeyEd1 in 'LbQKeyEd1.pas' {frmSymmetricKey}, 64 | LbQKeyEd2 in 'LbQKeyEd2.pas' {frmRSAKeys}, 65 | LbHttpShell in 'LbHttpShell.pas'; 66 | 67 | end. 68 | -------------------------------------------------------------------------------- /packages/L207cd60.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207cd60; 26 | 27 | {$R *.res} 28 | {$R '..\source\LbDesign.dcr'} 29 | {$ALIGN 8} 30 | {$ASSERTIONS OFF} 31 | {$BOOLEVAL OFF} 32 | {$DEBUGINFO OFF} 33 | {$EXTENDEDSYNTAX ON} 34 | {$IMPORTEDDATA ON} 35 | {$IOCHECKS ON} 36 | {$LOCALSYMBOLS OFF} 37 | {$LONGSTRINGS ON} 38 | {$OPENSTRINGS ON} 39 | {$OPTIMIZATION ON} 40 | {$OVERFLOWCHECKS OFF} 41 | {$RANGECHECKS OFF} 42 | {$REFERENCEINFO OFF} 43 | {$SAFEDIVIDE OFF} 44 | {$STACKFRAMES OFF} 45 | {$TYPEDADDRESS OFF} 46 | {$VARSTRINGCHECKS ON} 47 | {$WRITEABLECONST ON} 48 | {$MINENUMSIZE 1} 49 | {$IMAGEBASE $400000} 50 | {$DESCRIPTION 'TurboPower LockBox 2.07 CLX Design-time package - CLX60'} 51 | {$DESIGNONLY} 52 | {$IMPLICITBUILD ON} 53 | {$DEFINE UsingCLX} 54 | 55 | requires 56 | visualclx, 57 | designide, 58 | vclx, 59 | L207_r60; 60 | 61 | contains 62 | LbQDesign in '..\source\LbQDesign.pas', 63 | LbQKeyEd1 in '..\source\LbQKeyEd1.pas' {frmSymmetricKey}, 64 | LbQKeyEd2 in '..\source\LbQKeyEd2.pas' {frmRSAKeys}; 65 | 66 | end. 67 | -------------------------------------------------------------------------------- /examples/Delphi/ExHash1.pas: -------------------------------------------------------------------------------- 1 | unit ExHash1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | ExtCtrls, 15 | {$ENDIF} 16 | {$IFDEF LINUX} 17 | QForms, 18 | QStdCtrls, 19 | QExtCtrls, 20 | QControls, 21 | {$ENDIF} 22 | SysUtils, 23 | Classes; 24 | 25 | type 26 | TForm1 = class(TForm) 27 | edtDigest: TEdit; 28 | Label1: TLabel; 29 | edtMessage: TEdit; 30 | Label2: TLabel; 31 | rgHashMethod: TRadioGroup; 32 | btnGo: TButton; 33 | procedure btnGoClick(Sender: TObject); 34 | private 35 | { Private declarations } 36 | public 37 | { Public declarations } 38 | end; 39 | 40 | var 41 | Form1: TForm1; 42 | 43 | implementation 44 | 45 | {$R *.dfm} 46 | 47 | uses 48 | LbCipher, LbUtils; 49 | 50 | type 51 | THashMethod = (hmMD5, hmSHA1, hmLMD, hmELF); 52 | 53 | var 54 | MD5Digest : TMD5Digest; 55 | SHA1Digest : TSHA1Digest; 56 | ELFDigest : Longint; 57 | LMDDigest : Longint; 58 | 59 | procedure TForm1.btnGoClick(Sender: TObject); 60 | begin 61 | case THashMethod(rgHashMethod.ItemIndex) of 62 | hmMD5 : begin 63 | StringHashMD5(MD5Digest, edtMessage.Text); 64 | edtDigest.Text := BufferToHex(MD5Digest, SizeOf(MD5Digest)); 65 | end; 66 | hmSHA1 : begin 67 | StringHashSHA1(SHA1Digest, edtMessage.Text); 68 | edtDigest.Text := BufferToHex(SHA1Digest, SizeOf(SHA1Digest)); 69 | end; 70 | hmLMD : begin 71 | StringHashLMD(LMDDigest, SizeOf(LMDDigest), edtMessage.Text); 72 | edtDigest.Text := BufferToHex(LMDDigest, SizeOf(LMDDigest)); 73 | end; 74 | hmELF : begin 75 | StringHashELF(ELFDigest, edtMessage.Text); 76 | edtDigest.Text := BufferToHex(ELFDigest, SizeOf(ELFDigest)); 77 | end; 78 | end; 79 | end; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /examples/Kylix/ExHash1.pas: -------------------------------------------------------------------------------- 1 | unit ExHash1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | ExtCtrls, 15 | {$ENDIF} 16 | {$IFDEF LINUX} 17 | QForms, 18 | QStdCtrls, 19 | QExtCtrls, 20 | QControls, 21 | {$ENDIF} 22 | SysUtils, 23 | Classes; 24 | 25 | type 26 | TForm1 = class(TForm) 27 | edtDigest: TEdit; 28 | Label1: TLabel; 29 | edtMessage: TEdit; 30 | Label2: TLabel; 31 | rgHashMethod: TRadioGroup; 32 | btnGo: TButton; 33 | procedure btnGoClick(Sender: TObject); 34 | private 35 | { Private declarations } 36 | public 37 | { Public declarations } 38 | end; 39 | 40 | var 41 | Form1: TForm1; 42 | 43 | implementation 44 | 45 | {$R *.dfm} 46 | 47 | uses 48 | LbCipher, LbUtils; 49 | 50 | type 51 | THashMethod = (hmMD5, hmSHA1, hmLMD, hmELF); 52 | 53 | var 54 | MD5Digest : TMD5Digest; 55 | SHA1Digest : TSHA1Digest; 56 | ELFDigest : Longint; 57 | LMDDigest : Longint; 58 | 59 | procedure TForm1.btnGoClick(Sender: TObject); 60 | begin 61 | case THashMethod(rgHashMethod.ItemIndex) of 62 | hmMD5 : begin 63 | StringHashMD5(MD5Digest, edtMessage.Text); 64 | edtDigest.Text := BufferToHex(MD5Digest, SizeOf(MD5Digest)); 65 | end; 66 | hmSHA1 : begin 67 | StringHashSHA1(SHA1Digest, edtMessage.Text); 68 | edtDigest.Text := BufferToHex(SHA1Digest, SizeOf(SHA1Digest)); 69 | end; 70 | hmLMD : begin 71 | StringHashLMD(LMDDigest, SizeOf(LMDDigest), edtMessage.Text); 72 | edtDigest.Text := BufferToHex(LMDDigest, SizeOf(LMDDigest)); 73 | end; 74 | hmELF : begin 75 | StringHashELF(ELFDigest, edtMessage.Text); 76 | edtDigest.Text := BufferToHex(ELFDigest, SizeOf(ELFDigest)); 77 | end; 78 | end; 79 | end; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /packages/L207_d35.cpp: -------------------------------------------------------------------------------- 1 | // ***** BEGIN LICENSE BLOCK ***** 2 | // * Version: MPL 1.1 3 | // * 4 | // * The contents of this file are subject to the Mozilla Public License Version 5 | // * 1.1 (the "License"); you may not use this file except in compliance with 6 | // * the License. You may obtain a copy of the License at 7 | // * http://www.mozilla.org/MPL/ 8 | // * 9 | // * Software distributed under the License is distributed on an "AS IS" basis, 10 | // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | // * for the specific language governing rights and limitations under the 12 | // * License. 13 | // * 14 | // * The Original Code is TurboPower LockBox 15 | // * 16 | // * The Initial Developer of the Original Code is 17 | // * TurboPower Software 18 | // * 19 | // * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | // * the Initial Developer. All Rights Reserved. 21 | // * 22 | // * Contributor(s): 23 | // * 24 | // * ***** END LICENSE BLOCK ***** 25 | //--------------------------------------------------------------------------- 26 | #include 27 | #pragma hdrstop 28 | USERES("L207_d35.res"); 29 | USEPACKAGE("VCL35.bpi"); 30 | USEPACKAGE("VCLX35.bpi"); 31 | USEFORMNS("..\source\LbDesign.pas", Lbdesign, LbAboutForm); 32 | USERES("..\source\LbDesign.dcr"); 33 | USEFORMNS("..\source\LbKeyEd2.pas", Lbkeyed2, frmRSAKeys); 34 | USEFORMNS("..\source\LbKeyEd1.pas", Lbkeyed1, frmSymmetricKey); 35 | USEPACKAGE("L207_r35.bpi"); 36 | //--------------------------------------------------------------------------- 37 | #pragma package(smart_init) 38 | //--------------------------------------------------------------------------- 39 | // Package source. 40 | //--------------------------------------------------------------------------- 41 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 42 | { 43 | return 1; 44 | } 45 | //--------------------------------------------------------------------------- 46 | -------------------------------------------------------------------------------- /packages/L207_d41.cpp: -------------------------------------------------------------------------------- 1 | // ***** BEGIN LICENSE BLOCK ***** 2 | // * Version: MPL 1.1 3 | // * 4 | // * The contents of this file are subject to the Mozilla Public License Version 5 | // * 1.1 (the "License"); you may not use this file except in compliance with 6 | // * the License. You may obtain a copy of the License at 7 | // * http://www.mozilla.org/MPL/ 8 | // * 9 | // * Software distributed under the License is distributed on an "AS IS" basis, 10 | // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | // * for the specific language governing rights and limitations under the 12 | // * License. 13 | // * 14 | // * The Original Code is TurboPower LockBox 15 | // * 16 | // * The Initial Developer of the Original Code is 17 | // * TurboPower Software 18 | // * 19 | // * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | // * the Initial Developer. All Rights Reserved. 21 | // * 22 | // * Contributor(s): 23 | // * 24 | // * ***** END LICENSE BLOCK ***** 25 | //--------------------------------------------------------------------------- 26 | #include 27 | #pragma hdrstop 28 | USERES("L207_d41.res"); 29 | USEFORMNS("..\source\LbDesign.pas", Lbdesign, LbAboutForm); 30 | USERES("..\source\LbDesign.dcr"); 31 | USEFORMNS("..\source\LbKeyEd2.pas", Lbkeyed2, frmRSAKeys); 32 | USEFORMNS("..\source\LbKeyEd1.pas", Lbkeyed1, frmSymmetricKey); 33 | USEPACKAGE("vcl40.bpi"); 34 | USEPACKAGE("vclx40.bpi"); 35 | USEPACKAGE("L207_r41.bpi"); 36 | //--------------------------------------------------------------------------- 37 | #pragma package(smart_init) 38 | //--------------------------------------------------------------------------- 39 | // Package source. 40 | //--------------------------------------------------------------------------- 41 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 42 | { 43 | return 1; 44 | } 45 | //--------------------------------------------------------------------------- 46 | -------------------------------------------------------------------------------- /packages/L207_d51.cpp: -------------------------------------------------------------------------------- 1 | // ***** BEGIN LICENSE BLOCK ***** 2 | // * Version: MPL 1.1 3 | // * 4 | // * The contents of this file are subject to the Mozilla Public License Version 5 | // * 1.1 (the "License"); you may not use this file except in compliance with 6 | // * the License. You may obtain a copy of the License at 7 | // * http://www.mozilla.org/MPL/ 8 | // * 9 | // * Software distributed under the License is distributed on an "AS IS" basis, 10 | // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | // * for the specific language governing rights and limitations under the 12 | // * License. 13 | // * 14 | // * The Original Code is TurboPower LockBox 15 | // * 16 | // * The Initial Developer of the Original Code is 17 | // * TurboPower Software 18 | // * 19 | // * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | // * the Initial Developer. All Rights Reserved. 21 | // * 22 | // * Contributor(s): 23 | // * 24 | // * ***** END LICENSE BLOCK ***** 25 | //--------------------------------------------------------------------------- 26 | #include 27 | #pragma hdrstop 28 | USERES("L207_d51.res"); 29 | USEFORMNS("..\source\LbDesign.pas", Lbdesign, LbAboutForm); 30 | USERES("..\source\LbDesign.dcr"); 31 | USEFORMNS("..\source\LbKeyEd2.pas", Lbkeyed2, frmRSAKeys); 32 | USEFORMNS("..\source\LbKeyEd1.pas", Lbkeyed1, frmSymmetricKey); 33 | USEPACKAGE("vcl50.bpi"); 34 | USEPACKAGE("vclx50.bpi"); 35 | USEPACKAGE("L207_r51.bpi"); 36 | //--------------------------------------------------------------------------- 37 | #pragma package(smart_init) 38 | //--------------------------------------------------------------------------- 39 | // Package source. 40 | //--------------------------------------------------------------------------- 41 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 42 | { 43 | return 1; 44 | } 45 | //--------------------------------------------------------------------------- 46 | -------------------------------------------------------------------------------- /examples/CBuilder/RDLCmp1.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | 5 | #include "RDLCmp1.h" 6 | //--------------------------------------------------------------------------- 7 | #pragma package(smart_init) 8 | #pragma link "LbCipher" 9 | #pragma link "LbClass" 10 | #pragma resource "*.dfm" 11 | TForm1 *Form1; 12 | //--------------------------------------------------------------------------- 13 | __fastcall TForm1::TForm1(TComponent* Owner) 14 | : TForm(Owner) 15 | { 16 | } 17 | //--------------------------------------------------------------------------- 18 | 19 | void __fastcall TForm1::FormCreate(TObject *Sender) 20 | { 21 | cbxCipherMode->ItemIndex = Integer(LbRijndael1->CipherMode); 22 | cbxKeySize->ItemIndex = Integer(LbRijndael1->KeySize); 23 | } 24 | //--------------------------------------------------------------------------- 25 | 26 | void __fastcall TForm1::btnEncryptClick(TObject *Sender) 27 | { 28 | LbRijndael1->GenerateKey(edtPassphrase->Text); 29 | mmoCipherText->Text = LbRijndael1->EncryptString(mmoPlainText1->Text); 30 | mmoPlainText2->Clear(); 31 | } 32 | //--------------------------------------------------------------------------- 33 | void __fastcall TForm1::btnDecryptClick(TObject *Sender) 34 | { 35 | LbRijndael1->GenerateKey(edtPassphrase->Text); 36 | mmoPlainText2->Text = LbRijndael1->DecryptString(mmoCipherText->Text); 37 | } 38 | //--------------------------------------------------------------------------- 39 | void __fastcall TForm1::cbxCipherModeChange(TObject *Sender) 40 | { 41 | LbRijndael1->CipherMode = TLbCipherMode(cbxCipherMode->ItemIndex); 42 | } 43 | //--------------------------------------------------------------------------- 44 | void __fastcall TForm1::cbxKeySizeChange(TObject *Sender) 45 | { 46 | LbRijndael1->KeySize = TLbKeySizeRDL(cbxKeySize->ItemIndex); 47 | } 48 | //--------------------------------------------------------------------------- 49 | -------------------------------------------------------------------------------- /packages/tplockboxr.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package tplockboxr; 26 | 27 | {$R *.res} 28 | {$ALIGN 8} 29 | {$ASSERTIONS ON} 30 | {$BOOLEVAL OFF} 31 | {$DEBUGINFO ON} 32 | {$EXTENDEDSYNTAX ON} 33 | {$IMPORTEDDATA ON} 34 | {$IOCHECKS ON} 35 | {$LOCALSYMBOLS ON} 36 | {$LONGSTRINGS ON} 37 | {$OPENSTRINGS ON} 38 | {$OPTIMIZATION ON} 39 | {$OVERFLOWCHECKS OFF} 40 | {$RANGECHECKS OFF} 41 | {$REFERENCEINFO ON} 42 | {$SAFEDIVIDE OFF} 43 | {$STACKFRAMES OFF} 44 | {$TYPEDADDRESS OFF} 45 | {$VARSTRINGCHECKS ON} 46 | {$WRITEABLECONST ON} 47 | {$MINENUMSIZE 1} 48 | {$IMAGEBASE $400000} 49 | {$DESCRIPTION 'LockBock 2.0 Runtime'} 50 | {$RUNONLY} 51 | {$IMPLICITBUILD ON} 52 | requires 53 | visualclx, 54 | baseclx; 55 | 56 | contains 57 | LbUtils in 'LbUtils.pas', 58 | LbBigInt in 'LbBigInt.pas', 59 | LBCIPHER in 'LbCipher.pas', 60 | LbClass in 'LbClass.pas', 61 | LbConst in 'LbConst.pas', 62 | LbDSA in 'LbDSA.pas', 63 | LBPROC in 'LbProc.pas', 64 | LbRandom in 'LbRandom.pas', 65 | LbRSA in 'LbRSA.pas', 66 | LbString in 'LbString.pas', 67 | LbAsym in 'LbAsym.pas'; 68 | end. 69 | -------------------------------------------------------------------------------- /packages/L207cd70.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207cd70; 26 | 27 | {$R *.res} 28 | {$R '..\source\LbDesign.dcr'} 29 | {$ALIGN 8} 30 | {$ASSERTIONS OFF} 31 | {$BOOLEVAL OFF} 32 | {$DEBUGINFO OFF} 33 | {$EXTENDEDSYNTAX ON} 34 | {$IMPORTEDDATA ON} 35 | {$IOCHECKS ON} 36 | {$LOCALSYMBOLS OFF} 37 | {$LONGSTRINGS ON} 38 | {$OPENSTRINGS ON} 39 | {$OPTIMIZATION ON} 40 | {$OVERFLOWCHECKS OFF} 41 | {$RANGECHECKS OFF} 42 | {$REFERENCEINFO OFF} 43 | {$SAFEDIVIDE OFF} 44 | {$STACKFRAMES OFF} 45 | {$TYPEDADDRESS OFF} 46 | {$VARSTRINGCHECKS ON} 47 | {$WRITEABLECONST ON} 48 | {$MINENUMSIZE 1} 49 | {$IMAGEBASE $400000} 50 | {$DESCRIPTION 'TurboPower LockBox 2.07 CLX Design-time package - CLX70'} 51 | {$DESIGNONLY} 52 | {$IMPLICITBUILD ON} 53 | {$DEFINE UsingCLX} 54 | 55 | requires 56 | visualclx, 57 | designide, 58 | vclx, 59 | L207_r70, 60 | vcl, 61 | rtl, 62 | vclactnband; 63 | 64 | contains 65 | LbQKeyEd1 in '..\source\LbQKeyEd1.pas' {frmSymmetricKey}, 66 | LbQKeyEd2 in '..\source\LbQKeyEd2.pas' {frmRSAKeys}, 67 | LbQDesign in '..\source\LbQDesign.pas' {LbAboutForm}; 68 | 69 | end. 70 | -------------------------------------------------------------------------------- /packages/L207_r41.cpp: -------------------------------------------------------------------------------- 1 | // ***** BEGIN LICENSE BLOCK ***** 2 | // * Version: MPL 1.1 3 | // * 4 | // * The contents of this file are subject to the Mozilla Public License Version 5 | // * 1.1 (the "License"); you may not use this file except in compliance with 6 | // * the License. You may obtain a copy of the License at 7 | // * http://www.mozilla.org/MPL/ 8 | // * 9 | // * Software distributed under the License is distributed on an "AS IS" basis, 10 | // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | // * for the specific language governing rights and limitations under the 12 | // * License. 13 | // * 14 | // * The Original Code is TurboPower LockBox 15 | // * 16 | // * The Initial Developer of the Original Code is 17 | // * TurboPower Software 18 | // * 19 | // * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | // * the Initial Developer. All Rights Reserved. 21 | // * 22 | // * Contributor(s): 23 | // * 24 | // * ***** END LICENSE BLOCK ***** 25 | //--------------------------------------------------------------------------- 26 | #include 27 | #pragma hdrstop 28 | USERES("L207_r41.res"); 29 | USEPACKAGE("vcl40.bpi"); 30 | USEUNIT("..\source\LbUtils.pas"); 31 | USEUNIT("..\source\LbBigInt.pas"); 32 | USEUNIT("..\source\LBCIPHER.PAS"); 33 | USEUNIT("..\source\LbClass.pas"); 34 | USEUNIT("..\source\LbConst.pas"); 35 | USEUNIT("..\source\LbDSA.pas"); 36 | USEUNIT("..\source\LBPROC.PAS"); 37 | USEUNIT("..\source\LbRandom.pas"); 38 | USEUNIT("..\source\LbRSA.pas"); 39 | USEUNIT("..\source\LbString.pas"); 40 | USEUNIT("..\source\LbAsym.pas"); 41 | //--------------------------------------------------------------------------- 42 | #pragma package(smart_init) 43 | //--------------------------------------------------------------------------- 44 | // Package source. 45 | //--------------------------------------------------------------------------- 46 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 47 | { 48 | return 1; 49 | } 50 | //--------------------------------------------------------------------------- 51 | -------------------------------------------------------------------------------- /packages/L207_r51.cpp: -------------------------------------------------------------------------------- 1 | // ***** BEGIN LICENSE BLOCK ***** 2 | // * Version: MPL 1.1 3 | // * 4 | // * The contents of this file are subject to the Mozilla Public License Version 5 | // * 1.1 (the "License"); you may not use this file except in compliance with 6 | // * the License. You may obtain a copy of the License at 7 | // * http://www.mozilla.org/MPL/ 8 | // * 9 | // * Software distributed under the License is distributed on an "AS IS" basis, 10 | // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | // * for the specific language governing rights and limitations under the 12 | // * License. 13 | // * 14 | // * The Original Code is TurboPower LockBox 15 | // * 16 | // * The Initial Developer of the Original Code is 17 | // * TurboPower Software 18 | // * 19 | // * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | // * the Initial Developer. All Rights Reserved. 21 | // * 22 | // * Contributor(s): 23 | // * 24 | // * ***** END LICENSE BLOCK ***** 25 | //--------------------------------------------------------------------------- 26 | #include 27 | #pragma hdrstop 28 | USERES("L207_r51.res"); 29 | USEUNIT("..\source\LbUtils.pas"); 30 | USEUNIT("..\source\LbBigInt.pas"); 31 | USEUNIT("..\source\LBCIPHER.PAS"); 32 | USEUNIT("..\source\LbClass.pas"); 33 | USEUNIT("..\source\LbConst.pas"); 34 | USEUNIT("..\source\LbDSA.pas"); 35 | USEUNIT("..\source\LBPROC.PAS"); 36 | USEUNIT("..\source\LbRandom.pas"); 37 | USEUNIT("..\source\LbRSA.pas"); 38 | USEUNIT("..\source\LbString.pas"); 39 | USEUNIT("..\source\LbAsym.pas"); 40 | USEPACKAGE("vcl50.bpi"); 41 | //--------------------------------------------------------------------------- 42 | #pragma package(smart_init) 43 | //--------------------------------------------------------------------------- 44 | // Package source. 45 | //--------------------------------------------------------------------------- 46 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 47 | { 48 | return 1; 49 | } 50 | //--------------------------------------------------------------------------- 51 | -------------------------------------------------------------------------------- /examples/CBuilder/HashCmp1.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | 5 | #include "HashCmp1.h" 6 | #pragma link "LbUtils.obj" 7 | //--------------------------------------------------------------------------- 8 | #pragma package(smart_init) 9 | #pragma link "LbCipher" 10 | #pragma link "LbClass" 11 | #pragma resource "*.dfm" 12 | TForm1 *Form1; 13 | 14 | TMD5Digest MD5Digest; 15 | TSHA1Digest SHA1Digest; 16 | 17 | //--------------------------------------------------------------------------- 18 | __fastcall TForm1::TForm1(TComponent* Owner) 19 | : TForm(Owner) 20 | { 21 | } 22 | //--------------------------------------------------------------------------- 23 | void __fastcall TForm1::btnHashFileClick(TObject *Sender) 24 | { 25 | if (OpenDialog1->Execute()) { 26 | switch (rgHashMethod->ItemIndex) { 27 | case 0 : LbMD51->HashFile(OpenDialog1->FileName); 28 | LbMD51->GetDigest(MD5Digest); 29 | edtHash->Text = BufferToHex(MD5Digest, sizeof(MD5Digest)); 30 | break; 31 | case 1 : LbSHA11->HashFile(OpenDialog1->FileName); 32 | LbSHA11->GetDigest(SHA1Digest); 33 | edtHash->Text = BufferToHex(SHA1Digest, sizeof(SHA1Digest)); 34 | break; 35 | } 36 | } 37 | } 38 | //--------------------------------------------------------------------------- 39 | void __fastcall TForm1::btnHashStringClick(TObject *Sender) 40 | { 41 | AnsiString S = ""; 42 | if (InputQuery("HashCmp", "Enter String", S)) { 43 | switch (rgHashMethod->ItemIndex) { 44 | case 0 : LbMD51->HashString(S); 45 | LbMD51->GetDigest(MD5Digest); 46 | edtHash->Text = BufferToHex(MD5Digest, sizeof(MD5Digest)); 47 | break; 48 | case 1 : LbSHA11->HashString(S); 49 | LbSHA11->GetDigest(SHA1Digest); 50 | edtHash->Text = BufferToHex(SHA1Digest, sizeof(SHA1Digest)); 51 | break; 52 | } 53 | } 54 | } 55 | //--------------------------------------------------------------------------- 56 | -------------------------------------------------------------------------------- /packages/L207_r35.cpp: -------------------------------------------------------------------------------- 1 | // ***** BEGIN LICENSE BLOCK ***** 2 | // * Version: MPL 1.1 3 | // * 4 | // * The contents of this file are subject to the Mozilla Public License Version 5 | // * 1.1 (the "License"); you may not use this file except in compliance with 6 | // * the License. You may obtain a copy of the License at 7 | // * http://www.mozilla.org/MPL/ 8 | // * 9 | // * Software distributed under the License is distributed on an "AS IS" basis, 10 | // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | // * for the specific language governing rights and limitations under the 12 | // * License. 13 | // * 14 | // * The Original Code is TurboPower LockBox 15 | // * 16 | // * The Initial Developer of the Original Code is 17 | // * TurboPower Software 18 | // * 19 | // * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | // * the Initial Developer. All Rights Reserved. 21 | // * 22 | // * Contributor(s): 23 | // * 24 | // * ***** END LICENSE BLOCK ***** 25 | //--------------------------------------------------------------------------- 26 | #include 27 | #pragma hdrstop 28 | USERES("L207_r35.res"); 29 | USEPACKAGE("VCL35.bpi"); 30 | USEPACKAGE("VCLX35.bpi"); 31 | USEUNIT("..\source\LbUtils.pas"); 32 | USEUNIT("..\source\LbBigInt.pas"); 33 | USEUNIT("..\source\LBCIPHER.PAS"); 34 | USEUNIT("..\source\LbClass.pas"); 35 | USEUNIT("..\source\LbConst.pas"); 36 | USEUNIT("..\source\LbDSA.pas"); 37 | USEUNIT("..\source\LBPROC.PAS"); 38 | USEUNIT("..\source\LbRandom.pas"); 39 | USEUNIT("..\source\LbRSA.pas"); 40 | USEUNIT("..\source\LbString.pas"); 41 | USEUNIT("..\source\LbAsym.pas"); 42 | //--------------------------------------------------------------------------- 43 | #pragma package(smart_init) 44 | //--------------------------------------------------------------------------- 45 | // Package source. 46 | //--------------------------------------------------------------------------- 47 | int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) 48 | { 49 | return 1; 50 | } 51 | //--------------------------------------------------------------------------- 52 | -------------------------------------------------------------------------------- /packages/L207_r60.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207_r60; 26 | 27 | {$R *.res} 28 | {$ALIGN 8} 29 | {$ASSERTIONS OFF} 30 | {$BOOLEVAL OFF} 31 | {$DEBUGINFO OFF} 32 | {$EXTENDEDSYNTAX ON} 33 | {$IMPORTEDDATA ON} 34 | {$IOCHECKS ON} 35 | {$LOCALSYMBOLS OFF} 36 | {$LONGSTRINGS ON} 37 | {$OPENSTRINGS ON} 38 | {$OPTIMIZATION ON} 39 | {$OVERFLOWCHECKS OFF} 40 | {$RANGECHECKS OFF} 41 | {$REFERENCEINFO OFF} 42 | {$SAFEDIVIDE OFF} 43 | {$STACKFRAMES OFF} 44 | {$TYPEDADDRESS OFF} 45 | {$VARSTRINGCHECKS ON} 46 | {$WRITEABLECONST ON} 47 | {$MINENUMSIZE 1} 48 | {$IMAGEBASE $400000} 49 | {$DESCRIPTION 'TurboPower LockBox 2.07 Run-time package - RTL60'} 50 | {$RUNONLY} 51 | {$IMPLICITBUILD ON} 52 | 53 | requires 54 | rtl; 55 | 56 | contains 57 | LbUtils in '..\source\LbUtils.pas', 58 | LbBigInt in '..\source\LbBigInt.pas', 59 | LBCIPHER in '..\source\LBCIPHER.pas', 60 | LbConst in '..\source\LbConst.pas', 61 | LBPROC in '..\source\LBPROC.pas', 62 | LbRandom in '..\source\LbRandom.pas', 63 | LbString in '..\source\LbString.pas', 64 | LbAsym in '..\source\LbAsym.pas', 65 | LbClass in '..\source\LbClass.pas', 66 | LbDSA in '..\source\LbDSA.pas', 67 | LbRSA in '..\source\LbRSA.pas'; 68 | 69 | end. 70 | -------------------------------------------------------------------------------- /packages/L207_r70.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207_r70; 26 | 27 | {$R *.res} 28 | {$ALIGN 8} 29 | {$ASSERTIONS OFF} 30 | {$BOOLEVAL OFF} 31 | {$DEBUGINFO OFF} 32 | {$EXTENDEDSYNTAX ON} 33 | {$IMPORTEDDATA ON} 34 | {$IOCHECKS ON} 35 | {$LOCALSYMBOLS OFF} 36 | {$LONGSTRINGS ON} 37 | {$OPENSTRINGS ON} 38 | {$OPTIMIZATION ON} 39 | {$OVERFLOWCHECKS OFF} 40 | {$RANGECHECKS OFF} 41 | {$REFERENCEINFO OFF} 42 | {$SAFEDIVIDE OFF} 43 | {$STACKFRAMES OFF} 44 | {$TYPEDADDRESS OFF} 45 | {$VARSTRINGCHECKS ON} 46 | {$WRITEABLECONST ON} 47 | {$MINENUMSIZE 1} 48 | {$IMAGEBASE $400000} 49 | {$DESCRIPTION 'TurboPower LockBox 2.07 Run-time package - RTL70'} 50 | {$RUNONLY} 51 | {$IMPLICITBUILD ON} 52 | 53 | requires 54 | rtl; 55 | 56 | contains 57 | LbUtils in '..\source\LbUtils.pas', 58 | LbBigInt in '..\source\LbBigInt.pas', 59 | LBCIPHER in '..\source\LBCIPHER.pas', 60 | LbConst in '..\source\LbConst.pas', 61 | LBPROC in '..\source\LBPROC.pas', 62 | LbRandom in '..\source\LbRandom.pas', 63 | LbString in '..\source\LbString.pas', 64 | LbAsym in '..\source\LbAsym.pas', 65 | LbClass in '..\source\LbClass.pas', 66 | LbDSA in '..\source\LbDSA.pas', 67 | LbRSA in '..\source\LbRSA.pas'; 68 | 69 | end. 70 | -------------------------------------------------------------------------------- /packages/L207_r40.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207_r40; 26 | 27 | {$R *.RES} 28 | {$ALIGN ON} 29 | {$ASSERTIONS ON} 30 | {$BOOLEVAL OFF} 31 | {$DEBUGINFO OFF} 32 | {$EXTENDEDSYNTAX ON} 33 | {$IMPORTEDDATA ON} 34 | {$IOCHECKS ON} 35 | {$LOCALSYMBOLS OFF} 36 | {$LONGSTRINGS ON} 37 | {$OPENSTRINGS ON} 38 | {$OPTIMIZATION ON} 39 | {$OVERFLOWCHECKS OFF} 40 | {$RANGECHECKS OFF} 41 | {$REFERENCEINFO OFF} 42 | {$SAFEDIVIDE OFF} 43 | {$STACKFRAMES OFF} 44 | {$TYPEDADDRESS OFF} 45 | {$VARSTRINGCHECKS ON} 46 | {$WRITEABLECONST ON} 47 | {$MINENUMSIZE 1} 48 | {$IMAGEBASE $00400000} 49 | {$DESCRIPTION 'TurboPower LockBox 2.07 Run-time package - VCL40'} 50 | {$RUNONLY} 51 | {$IMPLICITBUILD ON} 52 | 53 | requires 54 | vcl40, 55 | vclx40; 56 | 57 | contains 58 | LbUtils in '..\source\LbUtils.pas', 59 | LbBigInt in '..\source\LbBigInt.pas', 60 | LBCIPHER in '..\source\LBCIPHER.pas', 61 | LbClass in '..\source\LbClass.pas', 62 | LbConst in '..\source\LbConst.pas', 63 | LbDSA in '..\source\LbDSA.pas', 64 | LBPROC in '..\source\LBPROC.pas', 65 | LbRandom in '..\source\LbRandom.pas', 66 | LbRSA in '..\source\LbRSA.pas', 67 | LbString in '..\source\LbString.pas', 68 | LbAsym in '..\source\LbAsym.pas'; 69 | 70 | end. 71 | -------------------------------------------------------------------------------- /packages/L207_r50.dpk: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | package L207_r50; 26 | 27 | {$R *.RES} 28 | {$ALIGN ON} 29 | {$ASSERTIONS OFF} 30 | {$BOOLEVAL OFF} 31 | {$DEBUGINFO OFF} 32 | {$EXTENDEDSYNTAX ON} 33 | {$IMPORTEDDATA ON} 34 | {$IOCHECKS ON} 35 | {$LOCALSYMBOLS OFF} 36 | {$LONGSTRINGS ON} 37 | {$OPENSTRINGS ON} 38 | {$OPTIMIZATION ON} 39 | {$OVERFLOWCHECKS OFF} 40 | {$RANGECHECKS OFF} 41 | {$REFERENCEINFO OFF} 42 | {$SAFEDIVIDE OFF} 43 | {$STACKFRAMES OFF} 44 | {$TYPEDADDRESS OFF} 45 | {$VARSTRINGCHECKS ON} 46 | {$WRITEABLECONST ON} 47 | {$MINENUMSIZE 1} 48 | {$IMAGEBASE $400000} 49 | {$DESCRIPTION 'TurboPower LockBox 2.07 Run-time package - VCL50'} 50 | {$RUNONLY} 51 | {$IMPLICITBUILD ON} 52 | 53 | requires 54 | vcl50, 55 | vclx50; 56 | 57 | contains 58 | LbUtils in '..\source\LbUtils.pas', 59 | LbBigInt in '..\source\LbBigInt.pas', 60 | LBCIPHER in '..\source\LBCIPHER.pas', 61 | LbClass in '..\source\LbClass.pas', 62 | LbConst in '..\source\LbConst.pas', 63 | LbDSA in '..\source\LbDSA.pas', 64 | LBPROC in '..\source\LBPROC.pas', 65 | LbRandom in '..\source\LbRandom.pas', 66 | LbRSA in '..\source\LbRSA.pas', 67 | LbString in '..\source\LbString.pas', 68 | LbAsym in '..\source\LbAsym.pas'; 69 | 70 | end. 71 | -------------------------------------------------------------------------------- /examples/Delphi/RDLCmp1.pas: -------------------------------------------------------------------------------- 1 | unit RDLCmp1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | {$ENDIF} 15 | {$IFDEF LINUX} 16 | QForms, 17 | QStdCtrls, 18 | QControls, 19 | {$ENDIF} 20 | SysUtils, 21 | Classes, 22 | LbClass, 23 | LbCipher; 24 | 25 | type 26 | TForm1 = class(TForm) 27 | btnEncrypt: TButton; 28 | btnDecrypt: TButton; 29 | Label4: TLabel; 30 | cbxCipherMode: TComboBox; 31 | mmoPlainText1: TMemo; 32 | Label5: TLabel; 33 | mmoCipherText: TMemo; 34 | Label7: TLabel; 35 | mmoPlainText2: TMemo; 36 | Label6: TLabel; 37 | Label1: TLabel; 38 | edtPassphrase: TEdit; 39 | LbRijndael1: TLbRijndael; 40 | Label2: TLabel; 41 | cbxKeySize: TComboBox; 42 | procedure btnEncryptClick(Sender: TObject); 43 | procedure btnDecryptClick(Sender: TObject); 44 | procedure FormCreate(Sender: TObject); 45 | procedure cbxCipherModeChange(Sender: TObject); 46 | procedure cbxKeySizeChange(Sender: TObject); 47 | end; 48 | 49 | var 50 | Form1: TForm1; 51 | 52 | implementation 53 | 54 | {$R *.dfm} 55 | 56 | 57 | procedure TForm1.FormCreate(Sender: TObject); 58 | begin 59 | cbxCipherMode.ItemIndex := Integer(LbRijndael1.CipherMode); 60 | cbxKeySize.ItemIndex := Integer(LbRijndael1.KeySize); 61 | end; 62 | 63 | procedure TForm1.btnEncryptClick(Sender: TObject); 64 | begin 65 | LbRijndael1.GenerateKey(edtPassphrase.Text); 66 | mmoCipherText.Text := LbRijndael1.EncryptString(mmoPlainText1.Text); 67 | mmoPlainText2.Clear; 68 | end; 69 | 70 | procedure TForm1.btnDecryptClick(Sender: TObject); 71 | begin 72 | LbRijndael1.GenerateKey(edtPassphrase.Text); 73 | mmoPlainText2.Text := LbRijndael1.DecryptString(mmoCipherText.Text); 74 | end; 75 | 76 | procedure TForm1.cbxCipherModeChange(Sender: TObject); 77 | begin 78 | LbRijndael1.CipherMode := TLbCipherMode(cbxCipherMode.ItemIndex); 79 | end; 80 | 81 | procedure TForm1.cbxKeySizeChange(Sender: TObject); 82 | begin 83 | LbRijndael1.KeySize := TLbKeySizeRDL(cbxKeySize.ItemIndex); 84 | end; 85 | 86 | end. 87 | -------------------------------------------------------------------------------- /examples/Kylix/RDLCmp1.pas: -------------------------------------------------------------------------------- 1 | unit RDLCmp1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | {$ENDIF} 15 | {$IFDEF LINUX} 16 | QForms, 17 | QStdCtrls, 18 | QControls, 19 | {$ENDIF} 20 | SysUtils, 21 | Classes, 22 | LbClass, 23 | LbCipher; 24 | 25 | type 26 | TForm1 = class(TForm) 27 | btnEncrypt: TButton; 28 | btnDecrypt: TButton; 29 | Label4: TLabel; 30 | cbxCipherMode: TComboBox; 31 | mmoPlainText1: TMemo; 32 | Label5: TLabel; 33 | mmoCipherText: TMemo; 34 | Label7: TLabel; 35 | mmoPlainText2: TMemo; 36 | Label6: TLabel; 37 | Label1: TLabel; 38 | edtPassphrase: TEdit; 39 | LbRijndael1: TLbRijndael; 40 | Label2: TLabel; 41 | cbxKeySize: TComboBox; 42 | procedure btnEncryptClick(Sender: TObject); 43 | procedure btnDecryptClick(Sender: TObject); 44 | procedure FormCreate(Sender: TObject); 45 | procedure cbxCipherModeChange(Sender: TObject); 46 | procedure cbxKeySizeChange(Sender: TObject); 47 | end; 48 | 49 | var 50 | Form1: TForm1; 51 | 52 | implementation 53 | 54 | {$R *.dfm} 55 | 56 | 57 | procedure TForm1.FormCreate(Sender: TObject); 58 | begin 59 | cbxCipherMode.ItemIndex := Integer(LbRijndael1.CipherMode); 60 | cbxKeySize.ItemIndex := Integer(LbRijndael1.KeySize); 61 | end; 62 | 63 | procedure TForm1.btnEncryptClick(Sender: TObject); 64 | begin 65 | LbRijndael1.GenerateKey(edtPassphrase.Text); 66 | mmoCipherText.Text := LbRijndael1.EncryptString(mmoPlainText1.Text); 67 | mmoPlainText2.Clear; 68 | end; 69 | 70 | procedure TForm1.btnDecryptClick(Sender: TObject); 71 | begin 72 | LbRijndael1.GenerateKey(edtPassphrase.Text); 73 | mmoPlainText2.Text := LbRijndael1.DecryptString(mmoCipherText.Text); 74 | end; 75 | 76 | procedure TForm1.cbxCipherModeChange(Sender: TObject); 77 | begin 78 | LbRijndael1.CipherMode := TLbCipherMode(cbxCipherMode.ItemIndex); 79 | end; 80 | 81 | procedure TForm1.cbxKeySizeChange(Sender: TObject); 82 | begin 83 | LbRijndael1.KeySize := TLbKeySizeRDL(cbxKeySize.ItemIndex); 84 | end; 85 | 86 | end. 87 | -------------------------------------------------------------------------------- /examples/CBuilder/ExRSAKe1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef ExRSAKe1H 3 | #define ExRSAKe1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | //--------------------------------------------------------------------------- 15 | class TForm1 : public TForm 16 | { 17 | __published: // IDE-managed Components 18 | TGroupBox *GroupBox4; 19 | TLabel *Label5; 20 | TButton *btnCreateKeys; 21 | TButton *btnFreeKeys; 22 | TEdit *edtIterations; 23 | TGroupBox *GroupBox1; 24 | TLabel *Label1; 25 | TLabel *Label2; 26 | TLabel *Label6; 27 | TEdit *edtPublicE; 28 | TEdit *edtPublicM; 29 | TButton *btnLoadPublic; 30 | TButton *btnSavePublic; 31 | TEdit *edtPublicPhrase; 32 | TGroupBox *GroupBox2; 33 | TLabel *Label3; 34 | TLabel *Label4; 35 | TLabel *Label7; 36 | TEdit *edtPrivateE; 37 | TEdit *edtPrivateM; 38 | TButton *btnLoadPrivate; 39 | TButton *btnSavePrivate; 40 | TEdit *edtPrivatePhrase; 41 | TStatusBar *StatusBar1; 42 | TOpenDialog *OpenDialog1; 43 | TSaveDialog *SaveDialog1; 44 | TLabel *Label8; 45 | TComboBox *cbxKeySize; 46 | void __fastcall FormCreate(TObject *Sender); 47 | void __fastcall btnCreateKeysClick(TObject *Sender); 48 | void __fastcall btnFreeKeysClick(TObject *Sender); 49 | void __fastcall btnLoadPublicClick(TObject *Sender); 50 | void __fastcall btnSavePublicClick(TObject *Sender); 51 | void __fastcall btnLoadPrivateClick(TObject *Sender); 52 | void __fastcall btnSavePrivateClick(TObject *Sender); 53 | private: // User declarations 54 | void __fastcall FreeKey(TLbRSAKey *Key); 55 | void __fastcall CreateKey(TLbRSAKey *Key); 56 | public: // User declarations 57 | __fastcall TForm1(TComponent* Owner); 58 | }; 59 | //--------------------------------------------------------------------------- 60 | extern PACKAGE TForm1 *Form1; 61 | //--------------------------------------------------------------------------- 62 | #endif 63 | -------------------------------------------------------------------------------- /examples/CBuilder/RSAKeys1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef RSAKeys1H 3 | #define RSAKeys1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "LbAsym.hpp" 10 | #include "LbCipher.hpp" 11 | #include "LbClass.hpp" 12 | #include "LbRSA.hpp" 13 | #include 14 | #include 15 | #include 16 | //--------------------------------------------------------------------------- 17 | class TForm1 : public TForm 18 | { 19 | __published: // IDE-managed Components 20 | TGroupBox *GroupBox4; 21 | TLabel *Label5; 22 | TLabel *Label8; 23 | TButton *btnCreateKeys; 24 | TEdit *edtIterations; 25 | TButton *btnClear; 26 | TGroupBox *GroupBox1; 27 | TLabel *Label1; 28 | TLabel *Label2; 29 | TLabel *Label6; 30 | TEdit *edtPublicE; 31 | TEdit *edtPublicM; 32 | TButton *btnLoadPublic; 33 | TButton *btnSavePublic; 34 | TEdit *edtPublicPhrase; 35 | TGroupBox *GroupBox2; 36 | TLabel *Label3; 37 | TLabel *Label4; 38 | TLabel *Label7; 39 | TEdit *edtPrivateE; 40 | TEdit *edtPrivateM; 41 | TButton *btnLoadPrivate; 42 | TButton *btnSavePrivate; 43 | TEdit *edtPrivatePhrase; 44 | TStatusBar *StatusBar1; 45 | TOpenDialog *OpenDialog1; 46 | TSaveDialog *SaveDialog1; 47 | TLbRSA *LbRSA1; 48 | TLabel *Label9; 49 | TComboBox *cbxKeySize; 50 | void __fastcall btnCreateKeysClick(TObject *Sender); 51 | void __fastcall btnLoadPublicClick(TObject *Sender); 52 | void __fastcall btnSavePublicClick(TObject *Sender); 53 | void __fastcall btnLoadPrivateClick(TObject *Sender); 54 | void __fastcall btnSavePrivateClick(TObject *Sender); 55 | void __fastcall btnClearClick(TObject *Sender); 56 | void __fastcall FormCreate(TObject *Sender); 57 | private: // User declarations 58 | public: // User declarations 59 | __fastcall TForm1(TComponent* Owner); 60 | }; 61 | //--------------------------------------------------------------------------- 62 | extern PACKAGE TForm1 *Form1; 63 | //--------------------------------------------------------------------------- 64 | #endif 65 | -------------------------------------------------------------------------------- /examples/Delphi/HashCmp1.pas: -------------------------------------------------------------------------------- 1 | unit HashCmp1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | ExtCtrls, 15 | {$ENDIF} 16 | {$IFDEF LINUX} 17 | QForms, 18 | QDialogs, 19 | QControls, 20 | QStdCtrls, 21 | QExtCtrls, 22 | {$ENDIF} 23 | SysUtils, 24 | Classes, 25 | LbClass, 26 | LbCipher; 27 | 28 | type 29 | TForm1 = class(TForm) 30 | LbMD51: TLbMD5; 31 | LbSHA11: TLbSHA1; 32 | btnHashFile: TButton; 33 | edtHash: TEdit; 34 | OpenDialog1: TOpenDialog; 35 | rgHashMethod: TRadioGroup; 36 | btnHashString: TButton; 37 | procedure btnHashFileClick(Sender: TObject); 38 | procedure btnHashStringClick(Sender: TObject); 39 | private 40 | { Private declarations } 41 | public 42 | { Public declarations } 43 | end; 44 | 45 | var 46 | Form1: TForm1; 47 | 48 | implementation 49 | 50 | {$R *.dfm} 51 | 52 | uses 53 | LbUtils; 54 | 55 | var 56 | MD5Digest : TMD5Digest; 57 | SHA1Digest : TSHA1Digest; 58 | 59 | procedure TForm1.btnHashFileClick(Sender: TObject); 60 | begin 61 | if OpenDialog1.Execute then begin 62 | case rgHashMethod.ItemIndex of 63 | 0 : begin 64 | LbMD51.HashFile(OpenDialog1.FileName); 65 | LbMD51.GetDigest(MD5Digest); 66 | edtHash.Text := BufferToHex(MD5Digest, SizeOf(MD5Digest)); 67 | end; 68 | 1 : begin 69 | LbSHA11.HashFile(OpenDialog1.FileName); 70 | LbSHA11.GetDigest(SHA1Digest); 71 | edtHash.Text := BufferToHex(SHA1Digest, SizeOf(SHA1Digest)); 72 | end; 73 | end; 74 | end; 75 | end; 76 | 77 | procedure TForm1.btnHashStringClick(Sender: TObject); 78 | var 79 | S : string; 80 | begin 81 | S := ''; 82 | if InputQuery('HashCmp', 'Enter String', S) then begin 83 | case rgHashMethod.ItemIndex of 84 | 0 : begin 85 | LbMD51.HashString(S); 86 | LbMD51.GetDigest(MD5Digest); 87 | edtHash.Text := BufferToHex(MD5Digest, SizeOf(MD5Digest)); 88 | end; 89 | 1 : begin 90 | LbSHA11.HashString(S); 91 | LbSHA11.GetDigest(SHA1Digest); 92 | edtHash.Text := BufferToHex(SHA1Digest, SizeOf(SHA1Digest)); 93 | end; 94 | end; 95 | end; 96 | end; 97 | 98 | end. 99 | -------------------------------------------------------------------------------- /examples/Kylix/HashCmp1.pas: -------------------------------------------------------------------------------- 1 | unit HashCmp1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | ExtCtrls, 15 | {$ENDIF} 16 | {$IFDEF LINUX} 17 | QForms, 18 | QDialogs, 19 | QControls, 20 | QStdCtrls, 21 | QExtCtrls, 22 | {$ENDIF} 23 | SysUtils, 24 | Classes, 25 | LbClass, 26 | LbCipher; 27 | 28 | type 29 | TForm1 = class(TForm) 30 | LbMD51: TLbMD5; 31 | LbSHA11: TLbSHA1; 32 | btnHashFile: TButton; 33 | edtHash: TEdit; 34 | OpenDialog1: TOpenDialog; 35 | rgHashMethod: TRadioGroup; 36 | btnHashString: TButton; 37 | procedure btnHashFileClick(Sender: TObject); 38 | procedure btnHashStringClick(Sender: TObject); 39 | private 40 | { Private declarations } 41 | public 42 | { Public declarations } 43 | end; 44 | 45 | var 46 | Form1: TForm1; 47 | 48 | implementation 49 | 50 | {$R *.dfm} 51 | 52 | uses 53 | LbUtils; 54 | 55 | var 56 | MD5Digest : TMD5Digest; 57 | SHA1Digest : TSHA1Digest; 58 | 59 | procedure TForm1.btnHashFileClick(Sender: TObject); 60 | begin 61 | if OpenDialog1.Execute then begin 62 | case rgHashMethod.ItemIndex of 63 | 0 : begin 64 | LbMD51.HashFile(OpenDialog1.FileName); 65 | LbMD51.GetDigest(MD5Digest); 66 | edtHash.Text := BufferToHex(MD5Digest, SizeOf(MD5Digest)); 67 | end; 68 | 1 : begin 69 | LbSHA11.HashFile(OpenDialog1.FileName); 70 | LbSHA11.GetDigest(SHA1Digest); 71 | edtHash.Text := BufferToHex(SHA1Digest, SizeOf(SHA1Digest)); 72 | end; 73 | end; 74 | end; 75 | end; 76 | 77 | procedure TForm1.btnHashStringClick(Sender: TObject); 78 | var 79 | S : string; 80 | begin 81 | S := ''; 82 | if InputQuery('HashCmp', 'Enter String', S) then begin 83 | case rgHashMethod.ItemIndex of 84 | 0 : begin 85 | LbMD51.HashString(S); 86 | LbMD51.GetDigest(MD5Digest); 87 | edtHash.Text := BufferToHex(MD5Digest, SizeOf(MD5Digest)); 88 | end; 89 | 1 : begin 90 | LbSHA11.HashString(S); 91 | LbSHA11.GetDigest(SHA1Digest); 92 | edtHash.Text := BufferToHex(SHA1Digest, SizeOf(SHA1Digest)); 93 | end; 94 | end; 95 | end; 96 | end; 97 | 98 | end. 99 | -------------------------------------------------------------------------------- /examples/CBuilder/DSACmp1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef DSACmp1H 3 | #define DSACmp1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "LbAsym.hpp" 10 | #include "LbCipher.hpp" 11 | #include "LbClass.hpp" 12 | #include "LbDSA.hpp" 13 | #include "LbUtils.hpp" 14 | #include 15 | //--------------------------------------------------------------------------- 16 | class TForm1 : public TForm 17 | { 18 | __published: // IDE-managed Components 19 | TLabel *Label1; 20 | TLabel *Label2; 21 | TLabel *Label3; 22 | TLabel *Label4; 23 | TLabel *Label5; 24 | TLabel *Label6; 25 | TLabel *Label7; 26 | TLabel *Label8; 27 | TLabel *Label9; 28 | TLabel *Label10; 29 | TLabel *Label11; 30 | TButton *btnGenParams; 31 | TMemo *mmoP; 32 | TMemo *mmoG; 33 | TMemo *mmoY; 34 | TEdit *edtMsg; 35 | TEdit *edtR; 36 | TEdit *edtS; 37 | TButton *btnSign; 38 | TEdit *edtQ; 39 | TEdit *edtX; 40 | TButton *btnVerify; 41 | TStatusBar *StatusBar1; 42 | TEdit *edtSeed; 43 | TEdit *edtXKey; 44 | TEdit *edtKKey; 45 | TButton *btnGenXY; 46 | TButton *btnSetParams; 47 | TButton *btnSetXY; 48 | TCheckBox *chkAbort; 49 | TLbDSA *LbDSA1; 50 | void __fastcall btnGenParamsClick(TObject *Sender); 51 | void __fastcall btnGenXYClick(TObject *Sender); 52 | void __fastcall btnSignClick(TObject *Sender); 53 | void __fastcall btnVerifyClick(TObject *Sender); 54 | void __fastcall btnSetParamsClick(TObject *Sender); 55 | void __fastcall btnSetXYClick(TObject *Sender); 56 | void __fastcall LbDSA1GetSeed(TObject *Sender, TLbDSABlock &Block); 57 | void __fastcall LbDSA1GetXKey(TObject *Sender, TLbDSABlock &Block); 58 | void __fastcall LbDSA1GetKKey(TObject *Sender, TLbDSABlock &Block); 59 | void __fastcall LbDSA1GetR(TObject *Sender, TLbDSABlock &Block); 60 | void __fastcall LbDSA1GetS(TObject *Sender, TLbDSABlock &Block); 61 | void __fastcall LbDSA1Progress(TObject *Sender, bool &Abort); 62 | private: // User declarations 63 | public: // User declarations 64 | __fastcall TForm1(TComponent* Owner); 65 | }; 66 | //--------------------------------------------------------------------------- 67 | extern PACKAGE TForm1 *Form1; 68 | //--------------------------------------------------------------------------- 69 | #endif 70 | -------------------------------------------------------------------------------- /examples/CBuilder/DSAKeys1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef DSAKeys1H 3 | #define DSAKeys1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "LbAsym.hpp" 10 | #include "LbCipher.hpp" 11 | #include "LbClass.hpp" 12 | #include "LbDSA.hpp" 13 | #include 14 | #include 15 | //--------------------------------------------------------------------------- 16 | class TfrmDSAKeys : public TForm 17 | { 18 | __published: // IDE-managed Components 19 | TGroupBox *GroupBox4; 20 | TLabel *Label5; 21 | TLabel *Label8; 22 | TLabel *Label9; 23 | TButton *btnCreateKeys; 24 | TEdit *edtIterations; 25 | TButton *btnClear; 26 | TComboBox *cbxKeySize; 27 | TGroupBox *GroupBox1; 28 | TLabel *Label6; 29 | TLabel *Label1; 30 | TLabel *Label2; 31 | TLabel *Label10; 32 | TLabel *Label11; 33 | TButton *btnLoadPublic; 34 | TButton *btnSavePublic; 35 | TEdit *edtPublicPhrase; 36 | TEdit *edtPubQ; 37 | TMemo *mmoPubP; 38 | TMemo *mmoPubG; 39 | TMemo *mmoPubY; 40 | TGroupBox *GroupBox2; 41 | TLabel *Label7; 42 | TLabel *Label3; 43 | TLabel *Label4; 44 | TLabel *Label12; 45 | TLabel *Label13; 46 | TButton *btnLoadPrivate; 47 | TButton *btnSavePrivate; 48 | TEdit *edtPrivatePhrase; 49 | TEdit *edtPriQ; 50 | TMemo *mmoPriP; 51 | TMemo *mmoPriG; 52 | TEdit *edtPriX; 53 | TStatusBar *StatusBar1; 54 | TOpenDialog *dlgOpenASN; 55 | TSaveDialog *dlgSaveASN; 56 | TLbDSA *LbDSA1; 57 | void __fastcall btnCreateKeysClick(TObject *Sender); 58 | void __fastcall btnLoadPublicClick(TObject *Sender); 59 | void __fastcall btnSavePublicClick(TObject *Sender); 60 | void __fastcall btnLoadPrivateClick(TObject *Sender); 61 | void __fastcall btnSavePrivateClick(TObject *Sender); 62 | void __fastcall btnClearClick(TObject *Sender); 63 | void __fastcall FormCreate(TObject *Sender); 64 | private: // User declarations 65 | void __fastcall UpdatePrivateKeyFields(); 66 | void __fastcall UpdatePublicKeyFields(); 67 | public: // User declarations 68 | __fastcall TfrmDSAKeys(TComponent* Owner); 69 | }; 70 | //--------------------------------------------------------------------------- 71 | extern PACKAGE TfrmDSAKeys *frmDSAKeys; 72 | //--------------------------------------------------------------------------- 73 | #endif 74 | -------------------------------------------------------------------------------- /examples/CBuilder/RSACmp1.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | 5 | #include "RSACmp1.h" 6 | //--------------------------------------------------------------------------- 7 | #pragma package(smart_init) 8 | #pragma link "LbAsym" 9 | #pragma link "LbCipher" 10 | #pragma link "LbClass" 11 | #pragma link "LbRSA" 12 | #pragma resource "*.dfm" 13 | TForm1 *Form1; 14 | //--------------------------------------------------------------------------- 15 | __fastcall TForm1::TForm1(TComponent* Owner) 16 | : TForm(Owner) 17 | { 18 | } 19 | //--------------------------------------------------------------------------- 20 | void __fastcall TForm1::btnEncryptClick(TObject *Sender) 21 | { 22 | Screen->Cursor = crHourGlass; 23 | StatusBar1->SimpleText = " Encrypting"; 24 | try { 25 | mmoCipherText->Text = LbRSA1->EncryptString(mmoPlainText1->Text); 26 | } 27 | catch (...) { 28 | } // swallow any errors 29 | Screen->Cursor = crDefault; 30 | StatusBar1->SimpleText = ""; 31 | mmoPlainText2->Clear(); 32 | } 33 | //--------------------------------------------------------------------------- 34 | void __fastcall TForm1::btnDecryptClick(TObject *Sender) 35 | { 36 | Screen->Cursor = crHourGlass; 37 | StatusBar1->SimpleText = " Decrypting"; 38 | try { 39 | mmoPlainText2->Text = LbRSA1->DecryptString(mmoCipherText->Text); 40 | } 41 | catch (...) { 42 | } // swallow any errors 43 | Screen->Cursor = crDefault; 44 | StatusBar1->SimpleText = ""; 45 | } 46 | //--------------------------------------------------------------------------- 47 | void __fastcall TForm1::btnGenKeysClick(TObject *Sender) 48 | { 49 | Screen->Cursor = crHourGlass; 50 | StatusBar1->SimpleText = " Generating RSA key pair- this may take a while"; 51 | try { 52 | LbRSA1->GenerateKeyPair(); 53 | btnEncrypt->Enabled = True; 54 | btnDecrypt->Enabled = True; 55 | } 56 | catch (...) { 57 | } // swallow any errors 58 | Screen->Cursor = crDefault; 59 | StatusBar1->SimpleText = ""; 60 | } 61 | //--------------------------------------------------------------------------- 62 | void __fastcall TForm1::FormCreate(TObject *Sender) 63 | { 64 | cbxKeySize->ItemIndex = (int) LbRSA1->KeySize; 65 | } 66 | //--------------------------------------------------------------------------- 67 | 68 | void __fastcall TForm1::cbxKeySizeChange(TObject *Sender) 69 | { 70 | LbRSA1->KeySize = (TLbAsymKeySize) cbxKeySize->ItemIndex; 71 | } 72 | //--------------------------------------------------------------------------- 73 | 74 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | TurboPower LockBox 2 | 3 | 4 | Table of contents 5 | 6 | 1. Introduction 7 | 2. Package names 8 | 3. Installation 9 | 4. Version history 10 | 4.1 Release 2.07 11 | 12 | ============================================== 13 | 14 | 15 | 1. Introduction 16 | 17 | 18 | LockBox is a cross-platform toolkit for data encryption. It contains 19 | routines & components for use with Borland Delphi, C++Builder, & 20 | Kylix. It provides support for Blowfish, RSA, MD5, SHA-1, DES, triple- 21 | DES, Rijndael, & digital signing of messages. 22 | 23 | This is a source-only release of TurboPower LockBox. It includes 24 | designtime and runtime packages for Delphi 3 through 7 and C++Builder 25 | 3 through 6. 26 | 27 | ============================================== 28 | 29 | 2. Package names 30 | 31 | 32 | TurboPower LockBox package names have the following form: 33 | 34 | LNNNMKVV.* 35 | | ||| 36 | | ||+------ VV VCL version (30=Delphi 3, 40=Delphi 4, 70=Delphi 7) 37 | | |+------- K Kind of package (R=runtime, D=designtime) 38 | | +-------- M Product-specific modifier (typically underscore, V = VCL, C = CLX) 39 | +----------- NNN Product version number (e.g., 207=version 2.07) 40 | 41 | 42 | For example, the LockBox CLX designtime package files for Delphi 7 have 43 | the filename L207CD70.*. 44 | 45 | ============================================== 46 | 47 | 3. Installation 48 | 49 | 50 | To install TurboPower LockBox into your IDE, take the following steps: 51 | 52 | 1. Unzip the release files into a directory (e.g., d:\lockbox). 53 | 54 | 2. Start Delphi or C++Builder. 55 | 56 | 3. Add the source subdirectory (e.g., d:\lockbox\source) to the 57 | IDE's library path. 58 | 59 | 4. Open & install the designtime package specific to the IDE being 60 | used. The IDE should notify you the components have been 61 | installed. 62 | 63 | a. For C++Builder 6 and Delphi 6 or higher, install the VCL 64 | design-time package (e.g., LxxxVDxx.*) when using LockBox 65 | classes with VCL applications. 66 | 67 | b. For C++Builder 6 and Delphi 6 or higher, install the CLX 68 | design-time package (e.g., LxxxCDxx.*) when using LockBox 69 | classes with CLX applications. 70 | 71 | 5. Make sure the PATH environmental variable contains the directory 72 | in which the compiled packages (i.e., BPL or DPL files) were 73 | placed. 74 | 75 | ============================================== 76 | 77 | 4. Version history 78 | 79 | 80 | 4.1 Release 2.07 81 | 82 | Enhancements 83 | ------------------------------------------------------------- 84 | Added support for Delphi 7 85 | -------------------------------------------------------------------------------- /packages/L207vd70.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=7.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=0 7 | D=0 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=1 14 | K=0 15 | L=0 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=0 27 | X=1 28 | Y=0 29 | Z=1 30 | ShowHints=1 31 | ShowWarnings=1 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | NamespacePrefix= 34 | SymbolDeprecated=1 35 | SymbolLibrary=1 36 | SymbolPlatform=1 37 | UnitLibrary=1 38 | UnitPlatform=1 39 | UnitDeprecated=1 40 | HResultCompat=1 41 | HidingMember=1 42 | HiddenVirtual=1 43 | Garbage=1 44 | BoundsError=1 45 | ZeroNilCompat=1 46 | StringConstTruncated=1 47 | ForLoopVarVarPar=1 48 | TypedConstVarPar=1 49 | AsgToTypedConst=1 50 | CaseLabelRange=1 51 | ForVariable=1 52 | ConstructingAbstract=1 53 | ComparisonFalse=1 54 | ComparisonTrue=1 55 | ComparingSignedUnsigned=1 56 | CombiningSignedUnsigned=1 57 | UnsupportedConstruct=1 58 | FileOpen=1 59 | FileOpenUnitSrc=1 60 | BadGlobalSymbol=1 61 | DuplicateConstructorDestructor=1 62 | InvalidDirective=1 63 | PackageNoLink=1 64 | PackageThreadVar=1 65 | ImplicitImport=1 66 | HPPEMITIgnored=1 67 | NoRetVal=1 68 | UseBeforeDef=1 69 | ForLoopVarUndef=1 70 | UnitNameMismatch=1 71 | NoCFGFileFound=1 72 | MessageDirective=1 73 | ImplicitVariants=1 74 | UnicodeToLocale=1 75 | LocaleToUnicode=1 76 | ImagebaseMultiple=1 77 | SuspiciousTypecast=1 78 | PrivatePropAccessor=1 79 | UnsafeType=0 80 | UnsafeCode=0 81 | UnsafeCast=0 82 | [Linker] 83 | MapFile=0 84 | OutputObjs=0 85 | ConsoleApp=1 86 | DebugInfo=0 87 | RemoteSymbols=0 88 | MinStackSize=16384 89 | MaxStackSize=1048576 90 | ImageBase=4194304 91 | ExeDescription=TurboPower LockBox 2.07 Design-time package - VCL60 92 | [Directories] 93 | OutputDir= 94 | UnitOutputDir= 95 | PackageDLLOutputDir= 96 | PackageDCPOutputDir= 97 | SearchPath= 98 | Packages= 99 | Conditionals= 100 | DebugSourceDirs= 101 | UsePackages=0 102 | [Parameters] 103 | RunParams= 104 | HostApplication= 105 | Launcher= 106 | UseLauncher=0 107 | DebugCWD= 108 | [Language] 109 | ActiveLang= 110 | ProjectLang= 111 | RootDir= 112 | [Version Info] 113 | IncludeVerInfo=1 114 | AutoIncBuild=0 115 | MajorVer=1 116 | MinorVer=0 117 | Release=0 118 | Build=0 119 | Debug=0 120 | PreRelease=0 121 | Special=0 122 | Private=0 123 | DLL=0 124 | Locale=1049 125 | CodePage=1251 126 | [Version Info Keys] 127 | CompanyName= 128 | FileDescription= 129 | FileVersion=1.0.0.0 130 | InternalName= 131 | LegalCopyright= 132 | LegalTrademarks= 133 | OriginalFilename= 134 | ProductName= 135 | ProductVersion=1.0.0.0 136 | Comments= 137 | -------------------------------------------------------------------------------- /packages/L207cd70.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=7.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=0 7 | D=0 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=1 14 | K=0 15 | L=0 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=0 27 | X=1 28 | Y=0 29 | Z=1 30 | ShowHints=1 31 | ShowWarnings=1 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | NamespacePrefix= 34 | SymbolDeprecated=1 35 | SymbolLibrary=1 36 | SymbolPlatform=1 37 | UnitLibrary=1 38 | UnitPlatform=1 39 | UnitDeprecated=1 40 | HResultCompat=1 41 | HidingMember=1 42 | HiddenVirtual=1 43 | Garbage=1 44 | BoundsError=1 45 | ZeroNilCompat=1 46 | StringConstTruncated=1 47 | ForLoopVarVarPar=1 48 | TypedConstVarPar=1 49 | AsgToTypedConst=1 50 | CaseLabelRange=1 51 | ForVariable=1 52 | ConstructingAbstract=1 53 | ComparisonFalse=1 54 | ComparisonTrue=1 55 | ComparingSignedUnsigned=1 56 | CombiningSignedUnsigned=1 57 | UnsupportedConstruct=1 58 | FileOpen=1 59 | FileOpenUnitSrc=1 60 | BadGlobalSymbol=1 61 | DuplicateConstructorDestructor=1 62 | InvalidDirective=1 63 | PackageNoLink=1 64 | PackageThreadVar=1 65 | ImplicitImport=1 66 | HPPEMITIgnored=1 67 | NoRetVal=1 68 | UseBeforeDef=1 69 | ForLoopVarUndef=1 70 | UnitNameMismatch=1 71 | NoCFGFileFound=1 72 | MessageDirective=1 73 | ImplicitVariants=1 74 | UnicodeToLocale=1 75 | LocaleToUnicode=1 76 | ImagebaseMultiple=1 77 | SuspiciousTypecast=1 78 | PrivatePropAccessor=1 79 | UnsafeType=0 80 | UnsafeCode=0 81 | UnsafeCast=0 82 | [Linker] 83 | MapFile=0 84 | OutputObjs=0 85 | ConsoleApp=1 86 | DebugInfo=0 87 | RemoteSymbols=0 88 | MinStackSize=16384 89 | MaxStackSize=1048576 90 | ImageBase=4194304 91 | ExeDescription=TurboPower LockBox 2.07 CLX Design-time package - CLX70 92 | [Directories] 93 | OutputDir= 94 | UnitOutputDir= 95 | PackageDLLOutputDir= 96 | PackageDCPOutputDir= 97 | SearchPath= 98 | Packages= 99 | Conditionals=UsingCLX 100 | DebugSourceDirs= 101 | UsePackages=0 102 | [Parameters] 103 | RunParams= 104 | HostApplication= 105 | Launcher= 106 | UseLauncher=0 107 | DebugCWD= 108 | [Language] 109 | ActiveLang= 110 | ProjectLang= 111 | RootDir= 112 | [Version Info] 113 | IncludeVerInfo=1 114 | AutoIncBuild=0 115 | MajorVer=1 116 | MinorVer=0 117 | Release=0 118 | Build=0 119 | Debug=0 120 | PreRelease=0 121 | Special=0 122 | Private=0 123 | DLL=0 124 | Locale=1049 125 | CodePage=1251 126 | [Version Info Keys] 127 | CompanyName= 128 | FileDescription= 129 | FileVersion=1.0.0.0 130 | InternalName= 131 | LegalCopyright= 132 | LegalTrademarks= 133 | OriginalFilename= 134 | ProductName= 135 | ProductVersion=1.0.0.0 136 | Comments= 137 | -------------------------------------------------------------------------------- /examples/Delphi/RSACmp1.pas: -------------------------------------------------------------------------------- 1 | unit RSACmp1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | ComCtrls, 15 | {$ENDIF} 16 | {$IFDEF LINUX} 17 | QForms, 18 | QStdCtrls, 19 | QControls, 20 | QExtCtrls, 21 | QComCtrls, 22 | {$ENDIF} 23 | SysUtils, 24 | Classes, 25 | LbRSA, 26 | LbCipher, 27 | LbClass, 28 | LbAsym; 29 | 30 | type 31 | TForm1 = class(TForm) 32 | btnEncrypt: TButton; 33 | btnDecrypt: TButton; 34 | mmoPlainText1: TMemo; 35 | Label5: TLabel; 36 | mmoCipherText: TMemo; 37 | Label7: TLabel; 38 | mmoPlainText2: TMemo; 39 | Label6: TLabel; 40 | btnGenKeys: TButton; 41 | LbRSA1: TLbRSA; 42 | StatusBar1: TStatusBar; 43 | cbxKeySize: TComboBox; 44 | Label1: TLabel; 45 | procedure btnEncryptClick(Sender: TObject); 46 | procedure btnDecryptClick(Sender: TObject); 47 | procedure btnGenKeysClick(Sender: TObject); 48 | procedure FormCreate(Sender: TObject); 49 | procedure cbxKeySizeChange(Sender: TObject); 50 | end; 51 | 52 | var 53 | Form1: TForm1; 54 | 55 | implementation 56 | 57 | {$R *.dfm} 58 | 59 | uses 60 | LbUtils; 61 | 62 | const 63 | sEncrypt = ' Encrypting'; 64 | sDecrypt = ' Decrypting'; 65 | sPatience = ' Generating RSA key pair - this may take a while'; 66 | 67 | 68 | procedure TForm1.FormCreate(Sender: TObject); 69 | { initialize edit controls } 70 | begin 71 | cbxKeySize.ItemIndex := Ord(LbRSA1.KeySize); 72 | end; 73 | 74 | procedure TForm1.btnGenKeysClick(Sender: TObject); 75 | { generate RSA key pair } 76 | begin 77 | Screen.Cursor := crHourGlass; 78 | StatusBar1.SimpleText := sPatience; 79 | try 80 | LbRSA1.GenerateKeyPair; 81 | btnEncrypt.Enabled := True; 82 | btnDecrypt.Enabled := True; 83 | finally 84 | Screen.Cursor := crDefault; 85 | StatusBar1.SimpleText := ''; 86 | end; 87 | end; 88 | 89 | procedure TForm1.btnEncryptClick(Sender: TObject); 90 | { encrypt plaintext string } 91 | begin 92 | Screen.Cursor := crHourGlass; 93 | StatusBar1.SimpleText := sEncrypt; 94 | try 95 | mmoCipherText.Text := LbRSA1.EncryptString(mmoPlainText1.Text); 96 | finally 97 | Screen.Cursor := crDefault; 98 | StatusBar1.SimpleText := ''; 99 | end; 100 | mmoPlainText2.Clear; 101 | end; 102 | 103 | procedure TForm1.btnDecryptClick(Sender: TObject); 104 | { decrypt encoded ciphertext } 105 | begin 106 | Screen.Cursor := crHourGlass; 107 | StatusBar1.SimpleText := sDecrypt; 108 | try 109 | mmoPlainText2.Text := LbRSA1.DecryptString(mmoCipherText.Text); 110 | finally 111 | Screen.Cursor := crDefault; 112 | StatusBar1.SimpleText := ''; 113 | end; 114 | end; 115 | 116 | procedure TForm1.cbxKeySizeChange(Sender: TObject); 117 | { key size changed } 118 | begin 119 | LbRSA1.KeySize := TLbAsymKeySize(cbxKeySize.ItemIndex); 120 | end; 121 | 122 | end. 123 | -------------------------------------------------------------------------------- /examples/Kylix/RSACmp1.pas: -------------------------------------------------------------------------------- 1 | unit RSACmp1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | ComCtrls, 15 | {$ENDIF} 16 | {$IFDEF LINUX} 17 | QForms, 18 | QStdCtrls, 19 | QControls, 20 | QExtCtrls, 21 | QComCtrls, 22 | {$ENDIF} 23 | SysUtils, 24 | Classes, 25 | LbRSA, 26 | LbCipher, 27 | LbClass, 28 | LbAsym; 29 | 30 | type 31 | TForm1 = class(TForm) 32 | btnEncrypt: TButton; 33 | btnDecrypt: TButton; 34 | mmoPlainText1: TMemo; 35 | Label5: TLabel; 36 | mmoCipherText: TMemo; 37 | Label7: TLabel; 38 | mmoPlainText2: TMemo; 39 | Label6: TLabel; 40 | btnGenKeys: TButton; 41 | LbRSA1: TLbRSA; 42 | StatusBar1: TStatusBar; 43 | cbxKeySize: TComboBox; 44 | Label1: TLabel; 45 | procedure btnEncryptClick(Sender: TObject); 46 | procedure btnDecryptClick(Sender: TObject); 47 | procedure btnGenKeysClick(Sender: TObject); 48 | procedure FormCreate(Sender: TObject); 49 | procedure cbxKeySizeChange(Sender: TObject); 50 | end; 51 | 52 | var 53 | Form1: TForm1; 54 | 55 | implementation 56 | 57 | {$R *.dfm} 58 | 59 | uses 60 | LbUtils; 61 | 62 | const 63 | sEncrypt = ' Encrypting'; 64 | sDecrypt = ' Decrypting'; 65 | sPatience = ' Generating RSA key pair - this may take a while'; 66 | 67 | 68 | procedure TForm1.FormCreate(Sender: TObject); 69 | { initialize edit controls } 70 | begin 71 | cbxKeySize.ItemIndex := Ord(LbRSA1.KeySize); 72 | end; 73 | 74 | procedure TForm1.btnGenKeysClick(Sender: TObject); 75 | { generate RSA key pair } 76 | begin 77 | Screen.Cursor := crHourGlass; 78 | StatusBar1.SimpleText := sPatience; 79 | try 80 | LbRSA1.GenerateKeyPair; 81 | btnEncrypt.Enabled := True; 82 | btnDecrypt.Enabled := True; 83 | finally 84 | Screen.Cursor := crDefault; 85 | StatusBar1.SimpleText := ''; 86 | end; 87 | end; 88 | 89 | procedure TForm1.btnEncryptClick(Sender: TObject); 90 | { encrypt plaintext string } 91 | begin 92 | Screen.Cursor := crHourGlass; 93 | StatusBar1.SimpleText := sEncrypt; 94 | try 95 | mmoCipherText.Text := LbRSA1.EncryptString(mmoPlainText1.Text); 96 | finally 97 | Screen.Cursor := crDefault; 98 | StatusBar1.SimpleText := ''; 99 | end; 100 | mmoPlainText2.Clear; 101 | end; 102 | 103 | procedure TForm1.btnDecryptClick(Sender: TObject); 104 | { decrypt encoded ciphertext } 105 | begin 106 | Screen.Cursor := crHourGlass; 107 | StatusBar1.SimpleText := sDecrypt; 108 | try 109 | mmoPlainText2.Text := LbRSA1.DecryptString(mmoCipherText.Text); 110 | finally 111 | Screen.Cursor := crDefault; 112 | StatusBar1.SimpleText := ''; 113 | end; 114 | end; 115 | 116 | procedure TForm1.cbxKeySizeChange(Sender: TObject); 117 | { key size changed } 118 | begin 119 | LbRSA1.KeySize := TLbAsymKeySize(cbxKeySize.ItemIndex); 120 | end; 121 | 122 | end. 123 | -------------------------------------------------------------------------------- /examples/CBuilder/RSASSA1.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | 5 | #include "RSASSA1.h" 6 | //--------------------------------------------------------------------------- 7 | #pragma package(smart_init) 8 | #pragma link "LbAsym" 9 | #pragma link "LbCipher" 10 | #pragma link "LbClass" 11 | #pragma link "LbUtils" 12 | #pragma link "LbRSA" 13 | #pragma resource "*.dfm" 14 | TForm1 *Form1; 15 | 16 | AnsiString sPass = "Signature verification: PASSED"; 17 | AnsiString sFail = "Signature verification: FAILED"; 18 | 19 | //--------------------------------------------------------------------------- 20 | __fastcall TForm1::TForm1(TComponent* Owner) 21 | : TForm(Owner) 22 | { 23 | } 24 | //--------------------------------------------------------------------------- 25 | void __fastcall TForm1::FormCreate(TObject *Sender) 26 | { 27 | cbxHashMethod->ItemIndex = (int) LbRSASSA1->HashMethod; 28 | cbxKeySize->ItemIndex = (int) LbRSASSA1->KeySize - 1; 29 | } 30 | //--------------------------------------------------------------------------- 31 | void __fastcall TForm1::btnGenKeysClick(TObject *Sender) 32 | { 33 | Screen->Cursor = crHourGlass; 34 | StatusBar1->SimpleText = " Generating RSA key pair- this may take a while"; 35 | try { 36 | LbRSASSA1->GenerateKeyPair(); 37 | } 38 | __finally { 39 | Screen->Cursor = crDefault; 40 | StatusBar1->SimpleText = ""; 41 | } 42 | } 43 | //--------------------------------------------------------------------------- 44 | void __fastcall TForm1::cbxKeySizeChange(TObject *Sender) 45 | { 46 | LbRSASSA1->KeySize = (TLbAsymKeySize) (cbxKeySize->ItemIndex + 1); 47 | } 48 | //--------------------------------------------------------------------------- 49 | 50 | void __fastcall TForm1::cbxHashMethodChange(TObject *Sender) 51 | { 52 | LbRSASSA1->HashMethod = (TRSAHashMethod) cbxHashMethod->ItemIndex; 53 | } 54 | //--------------------------------------------------------------------------- 55 | 56 | void __fastcall TForm1::LbRSASSA1GetSignature(TObject *Sender, 57 | TRSASignatureBlock &Sig) 58 | { 59 | HexToBuffer(mmoSignature->Text, Sig, sizeof(Sig)); 60 | } 61 | //--------------------------------------------------------------------------- 62 | 63 | void __fastcall TForm1::btnSignClick(TObject *Sender) 64 | { 65 | Screen->Cursor = crHourGlass; 66 | StatusBar1->SimpleText = " Generating signature"; 67 | try { 68 | LbRSASSA1->SignString(edtMsg->Text); 69 | mmoSignature->Text = LbRSASSA1->Signature->IntStr; 70 | } 71 | __finally { 72 | Screen->Cursor = crDefault; 73 | StatusBar1->SimpleText = ""; 74 | } 75 | } 76 | //--------------------------------------------------------------------------- 77 | 78 | void __fastcall TForm1::btnVerifyClick(TObject *Sender) 79 | { 80 | if (LbRSASSA1->VerifyString(edtMsg->Text)) 81 | StatusBar1->SimpleText = " Signature verification: PASSED"; 82 | else 83 | StatusBar1->SimpleText = " Signature verification: Failed"; 84 | } 85 | //--------------------------------------------------------------------------- 86 | 87 | -------------------------------------------------------------------------------- /examples/CBuilder/ExFile1.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | 5 | #include "ExFile1.h" 6 | #pragma link "LbCipher.obj" 7 | #pragma link "LbProc.obj" 8 | //--------------------------------------------------------------------------- 9 | #pragma package(smart_init) 10 | #pragma resource "*.dfm" 11 | TForm1 *Form1; 12 | 13 | TKey64 Key64; 14 | TKey128 Key128; 15 | TKey192 Key192; 16 | TKey256 Key256; 17 | 18 | enum TEncryption { eBf, eBfCbc, eDes, eDesCbc, e3Des, e3DesCbc, eRdl, eRdlCbc }; 19 | 20 | 21 | //--------------------------------------------------------------------------- 22 | __fastcall TForm1::TForm1(TComponent* Owner) 23 | : TForm(Owner) 24 | { 25 | } 26 | //--------------------------------------------------------------------------- 27 | void __fastcall TForm1::FormCreate(TObject *Sender) 28 | { 29 | cbxCipher->ItemIndex = (int) eDes; 30 | } 31 | //--------------------------------------------------------------------------- 32 | void __fastcall TForm1::btnGoClick(TObject *Sender) 33 | { 34 | Screen->Cursor = crHourGlass; 35 | GenerateLMDKey(Key64, sizeof(Key64), edtPassphrase->Text); 36 | GenerateLMDKey(Key128, sizeof(Key128), edtPassphrase->Text); 37 | GenerateLMDKey(Key192, sizeof(Key192), edtPassphrase->Text); 38 | GenerateLMDKey(Key256, sizeof(Key256), edtPassphrase->Text); 39 | try { 40 | switch ((TEncryption) cbxCipher->ItemIndex) { 41 | case eBf : BFEncryptFile(edtInFile->Text, edtOutFile->Text, Key128, chkEncrypt->Checked); 42 | break; 43 | case eBfCbc : BFEncryptFileCBC(edtInFile->Text, edtOutFile->Text, Key128, chkEncrypt->Checked); 44 | break; 45 | case eDes : DESEncryptFile(edtInFile->Text, edtOutFile->Text, Key64, chkEncrypt->Checked); 46 | break; 47 | case eDesCbc : DESEncryptFileCBC(edtInFile->Text, edtOutFile->Text, Key64, chkEncrypt->Checked); 48 | break; 49 | case e3Des : TripleDESEncryptFile(edtInFile->Text, edtOutFile->Text, Key128, chkEncrypt->Checked); 50 | break; 51 | case e3DesCbc : TripleDESEncryptFileCBC(edtInFile->Text, edtOutFile->Text, Key128, chkEncrypt->Checked); 52 | break; 53 | case eRdl : RDLEncryptFile(edtInFile->Text, edtOutFile->Text, Key128, 16, chkEncrypt->Checked); 54 | break; 55 | case eRdlCbc : RDLEncryptFileCBC(edtInFile->Text, edtOutFile->Text, Key128, 16, chkEncrypt->Checked); 56 | break; 57 | } 58 | } 59 | catch (...) { 60 | } // swallow any errors 61 | Screen->Cursor = crDefault; 62 | } 63 | //--------------------------------------------------------------------------- 64 | void __fastcall TForm1::SpeedButton1Click(TObject *Sender) 65 | { 66 | if (OpenDialog1->Execute()) 67 | edtInFile->Text = OpenDialog1->FileName; 68 | } 69 | //--------------------------------------------------------------------------- 70 | void __fastcall TForm1::SpeedButton2Click(TObject *Sender) 71 | { 72 | if (SaveDialog1->Execute()) 73 | edtOutFile->Text = SaveDialog1->FileName; 74 | } 75 | //--------------------------------------------------------------------------- 76 | -------------------------------------------------------------------------------- /examples/Delphi/ExFile1.pas: -------------------------------------------------------------------------------- 1 | unit ExFile1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | Buttons, 15 | {$ENDIF} 16 | {$IFDEF LINUX} 17 | QForms, 18 | QDialogs, 19 | QStdCtrls, 20 | QControls, 21 | QButtons, 22 | {$ENDIF} 23 | SysUtils, 24 | Classes; 25 | 26 | type 27 | TForm1 = class(TForm) 28 | btnGo: TButton; 29 | Label4: TLabel; 30 | cbxCipher: TComboBox; 31 | edtInFile: TEdit; 32 | edtOutFile: TEdit; 33 | SpeedButton1: TSpeedButton; 34 | SpeedButton2: TSpeedButton; 35 | Label1: TLabel; 36 | Label2: TLabel; 37 | chkEncrypt: TCheckBox; 38 | OpenDialog1: TOpenDialog; 39 | SaveDialog1: TSaveDialog; 40 | Label3: TLabel; 41 | edtPassphrase: TEdit; 42 | procedure btnGoClick(Sender: TObject); 43 | procedure FormCreate(Sender: TObject); 44 | procedure SpeedButton1Click(Sender: TObject); 45 | procedure SpeedButton2Click(Sender: TObject); 46 | private 47 | procedure RefreshKeys; 48 | end; 49 | 50 | var 51 | Form1: TForm1; 52 | 53 | implementation 54 | 55 | {$R *.dfm} 56 | 57 | uses 58 | LbCipher, LbProc; 59 | 60 | type 61 | TEncryption = (eBf, eBfCbc, eDes, eDesCbc, e3Des, e3DesCbc, eRdl, eRdlCbc); 62 | 63 | var 64 | Key64 : TKey64; 65 | Key128 : TKey128; 66 | Key192 : TKey192; 67 | Key256 : TKey256; 68 | 69 | 70 | procedure TForm1.FormCreate(Sender: TObject); 71 | begin 72 | cbxCipher.ItemIndex := Integer(eDes); 73 | end; 74 | 75 | procedure TForm1.btnGoClick(Sender: TObject); 76 | begin 77 | Screen.Cursor := crHourglass; 78 | RefreshKeys; 79 | try 80 | case TEncryption(cbxCipher.ItemIndex) of 81 | eBf : BFEncryptFile(edtInfile.Text, edtOutfile.Text, Key128, chkEncrypt.Checked); 82 | eBfCbc : BFEncryptFileCBC(edtInfile.Text, edtOutfile.Text, Key128, chkEncrypt.Checked); 83 | eDes : DESEncryptFile(edtInfile.Text, edtOutfile.Text, Key64, chkEncrypt.Checked); 84 | eDesCbc : DESEncryptFileCBC(edtInfile.Text, edtOutfile.Text, Key64, chkEncrypt.Checked); 85 | e3Des : TripleDESEncryptFile(edtInfile.Text, edtOutfile.Text, Key128, chkEncrypt.Checked); 86 | e3DesCbc : TripleDESEncryptFileCBC(edtInfile.Text, edtOutfile.Text, Key128, chkEncrypt.Checked); 87 | eRdl : RDLEncryptFile(edtInfile.Text, edtOutfile.Text, Key128, 16, chkEncrypt.Checked); 88 | eRdlCbc : RDLEncryptFileCBC(edtInfile.Text, edtOutfile.Text, Key128, 16, chkEncrypt.Checked); 89 | end; 90 | finally 91 | Screen.Cursor := crDefault; 92 | end; 93 | end; 94 | 95 | procedure TForm1.SpeedButton1Click(Sender: TObject); 96 | begin 97 | if OpenDialog1.Execute then 98 | edtInFile.Text := OpenDialog1.FileName; 99 | end; 100 | 101 | procedure TForm1.SpeedButton2Click(Sender: TObject); 102 | begin 103 | if SaveDialog1.Execute then 104 | edtOutfile.Text := SaveDialog1.FileName; 105 | end; 106 | 107 | procedure TForm1.RefreshKeys; 108 | begin 109 | GenerateLMDKey(Key64, SizeOf(Key64), edtPassphrase.Text); 110 | GenerateLMDKey(Key128, SizeOf(Key128), edtPassphrase.Text); 111 | GenerateLMDKey(Key192, SizeOf(Key192), edtPassphrase.Text); 112 | GenerateLMDKey(Key256, SizeOf(Key256), edtPassphrase.Text); 113 | end; 114 | 115 | end. 116 | -------------------------------------------------------------------------------- /examples/Kylix/ExFile1.pas: -------------------------------------------------------------------------------- 1 | unit ExFile1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | Buttons, 15 | {$ENDIF} 16 | {$IFDEF LINUX} 17 | QForms, 18 | QDialogs, 19 | QStdCtrls, 20 | QControls, 21 | QButtons, 22 | {$ENDIF} 23 | SysUtils, 24 | Classes; 25 | 26 | type 27 | TForm1 = class(TForm) 28 | btnGo: TButton; 29 | Label4: TLabel; 30 | cbxCipher: TComboBox; 31 | edtInFile: TEdit; 32 | edtOutFile: TEdit; 33 | SpeedButton1: TSpeedButton; 34 | SpeedButton2: TSpeedButton; 35 | Label1: TLabel; 36 | Label2: TLabel; 37 | chkEncrypt: TCheckBox; 38 | OpenDialog1: TOpenDialog; 39 | SaveDialog1: TSaveDialog; 40 | Label3: TLabel; 41 | edtPassphrase: TEdit; 42 | procedure btnGoClick(Sender: TObject); 43 | procedure FormCreate(Sender: TObject); 44 | procedure SpeedButton1Click(Sender: TObject); 45 | procedure SpeedButton2Click(Sender: TObject); 46 | private 47 | procedure RefreshKeys; 48 | end; 49 | 50 | var 51 | Form1: TForm1; 52 | 53 | implementation 54 | 55 | {$R *.dfm} 56 | 57 | uses 58 | LbCipher, LbProc; 59 | 60 | type 61 | TEncryption = (eBf, eBfCbc, eDes, eDesCbc, e3Des, e3DesCbc, eRdl, eRdlCbc); 62 | 63 | var 64 | Key64 : TKey64; 65 | Key128 : TKey128; 66 | Key192 : TKey192; 67 | Key256 : TKey256; 68 | 69 | 70 | procedure TForm1.FormCreate(Sender: TObject); 71 | begin 72 | cbxCipher.ItemIndex := Integer(eDes); 73 | end; 74 | 75 | procedure TForm1.btnGoClick(Sender: TObject); 76 | begin 77 | Screen.Cursor := crHourglass; 78 | RefreshKeys; 79 | try 80 | case TEncryption(cbxCipher.ItemIndex) of 81 | eBf : BFEncryptFile(edtInfile.Text, edtOutfile.Text, Key128, chkEncrypt.Checked); 82 | eBfCbc : BFEncryptFileCBC(edtInfile.Text, edtOutfile.Text, Key128, chkEncrypt.Checked); 83 | eDes : DESEncryptFile(edtInfile.Text, edtOutfile.Text, Key64, chkEncrypt.Checked); 84 | eDesCbc : DESEncryptFileCBC(edtInfile.Text, edtOutfile.Text, Key64, chkEncrypt.Checked); 85 | e3Des : TripleDESEncryptFile(edtInfile.Text, edtOutfile.Text, Key128, chkEncrypt.Checked); 86 | e3DesCbc : TripleDESEncryptFileCBC(edtInfile.Text, edtOutfile.Text, Key128, chkEncrypt.Checked); 87 | eRdl : RDLEncryptFile(edtInfile.Text, edtOutfile.Text, Key128, 16, chkEncrypt.Checked); 88 | eRdlCbc : RDLEncryptFileCBC(edtInfile.Text, edtOutfile.Text, Key128, 16, chkEncrypt.Checked); 89 | end; 90 | finally 91 | Screen.Cursor := crDefault; 92 | end; 93 | end; 94 | 95 | procedure TForm1.SpeedButton1Click(Sender: TObject); 96 | begin 97 | if OpenDialog1.Execute then 98 | edtInFile.Text := OpenDialog1.FileName; 99 | end; 100 | 101 | procedure TForm1.SpeedButton2Click(Sender: TObject); 102 | begin 103 | if SaveDialog1.Execute then 104 | edtOutfile.Text := SaveDialog1.FileName; 105 | end; 106 | 107 | procedure TForm1.RefreshKeys; 108 | begin 109 | GenerateLMDKey(Key64, SizeOf(Key64), edtPassphrase.Text); 110 | GenerateLMDKey(Key128, SizeOf(Key128), edtPassphrase.Text); 111 | GenerateLMDKey(Key192, SizeOf(Key192), edtPassphrase.Text); 112 | GenerateLMDKey(Key256, SizeOf(Key256), edtPassphrase.Text); 113 | end; 114 | 115 | end. 116 | -------------------------------------------------------------------------------- /source/ExtraDeletes: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | #-----------------------------------------------------------------------------# 3 | # default settings 4 | #-----------------------------------------------------------------------------# 5 | VV="-vv" 6 | V="-v" 7 | 8 | 9 | COUNT=$# 10 | if [ $COUNT = "0" ];then 11 | VERBOSE=none 12 | fi 13 | if [ $COUNT != "0" ];then 14 | if [ $1 = $V ] || [ $1 = $VV ]; then 15 | VERBOSE=$1 16 | else 17 | VERBOSE=none 18 | fi 19 | fi 20 | 21 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 22 | echo -e 'find . -type f -iname "*~*" -print -exec rm -f {} \;' 23 | find . -type f -iname "*~*" -print -exec rm -f {} \; 24 | fi 25 | find . -type f -iname "*~*" -exec rm -f {} \; 26 | 27 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 28 | echo -e 'find . -type f -iname "*.dcu" -print -exec rm -f {} \;' 29 | find . -type f -iname "*.dcu" -print -exec rm -f {} \; 30 | fi 31 | find . -type f -iname "*.dcu" -exec rm -f {} \; 32 | 33 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 34 | echo -e 'find . -type f -iname "*.dpu" -print -exec rm -f {} \;' 35 | find . -type f -iname "*.dpu" -print -exec rm -f {} \; 36 | fi 37 | find . -type f -iname "*.dpu" -exec rm -f {} \; 38 | 39 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 40 | echo -e 'find . -type f -iname "*.dcp" -print -exec rm -f {} \;' 41 | find . -type f -iname "*.dcp" -print -exec rm -f {} \; 42 | fi 43 | find . -type f -iname "*.dcp" -exec rm -f {} \; 44 | 45 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 46 | echo -e 'find . -type f -iname "*.kof" -print -exec rm -f {} \;' 47 | find . -type f -iname "*.kof" -print -exec rm -f {} \; 48 | fi 49 | find . -type f -iname "*.kof" -exec rm -f {} \; 50 | 51 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 52 | echo -e 'find . -type f -iname "*.scc" -print -exec rm -f {} \;' 53 | find . -type f -iname "*.scc" -print -exec rm -f {} \; 54 | fi 55 | find . -type f -iname "*.scc" -exec rm -f {} \; 56 | 57 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 58 | echo -e 'find . -type f -perm -print -755 -exec rm -f {} \'; 59 | find . -type f -perm -755 -print -exec rm -f {} \; 60 | fi 61 | find . -type f -perm -755 -exec rm -f {} \; 62 | 63 | if [ -e "nohup.out" ]; then 64 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 65 | echo -e 'rm nohup.out' 66 | fi 67 | rm nohup.out; 68 | fi 69 | 70 | if [ -e "clear" ]; then 71 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 72 | echo -e 'rm clear'; 73 | fi 74 | rm clear; 75 | fi 76 | 77 | if [ -e "CreateRPM" ]; then 78 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 79 | echo -e 'rm CreateRPM'; 80 | fi 81 | rm CreateRPM; 82 | fi 83 | 84 | if [ -e "CreateRPMs.sh" ]; then 85 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 86 | echo -e 'rm CreateRPM.sh'; 87 | fi 88 | rm CreateRPMs.sh; 89 | fi 90 | 91 | if [ -e "ExtraDeletes" ]; then 92 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 93 | echo -e 'rm ExtraDeletes'; 94 | fi 95 | rm ExtraDeletes; 96 | fi 97 | 98 | if [ -d "dunit" ]; then 99 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 100 | echo -e 'rm -rf dunit'; 101 | rm -rvf dunit; 102 | fi 103 | rm -rf dunit; 104 | fi 105 | 106 | if [ -d "Help" ]; then 107 | if [ $VERBOSE = $V ] || [ $VERBOSE = $VV ]; then 108 | echo -e 'rm -rf Help'; 109 | rm -rvf Help; 110 | fi 111 | rm -rf Help; 112 | fi 113 | 114 | -------------------------------------------------------------------------------- /examples/CBuilder/DSASig1.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef DSASig1H 3 | #define DSASig1H 4 | //--------------------------------------------------------------------------- 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "LbAsym.hpp" 10 | #include "LbCipher.hpp" 11 | #include "LbClass.hpp" 12 | #include "LbDSA.hpp" 13 | #include "LbUtils.hpp" 14 | #include 15 | #include 16 | #include 17 | //--------------------------------------------------------------------------- 18 | class TfrmDSASig : public TForm 19 | { 20 | __published: // IDE-managed Components 21 | TStatusBar *StatusBar1; 22 | TGroupBox *GroupBox1; 23 | TLabel *Label1; 24 | TLabel *Label2; 25 | TLabel *Label3; 26 | TLabel *Label4; 27 | TEdit *edtPriQ; 28 | TMemo *mmoPriP; 29 | TMemo *mmoPriG; 30 | TEdit *edtPriX; 31 | TGroupBox *GroupBox2; 32 | TLabel *Label5; 33 | TLabel *Label9; 34 | TLabel *Label10; 35 | TLabel *Label11; 36 | TEdit *edtPubQ; 37 | TMemo *mmoPubP; 38 | TMemo *mmoPubG; 39 | TMemo *mmoPubY; 40 | TGroupBox *GroupBox3; 41 | TLabel *Label7; 42 | TLabel *Label8; 43 | TEdit *edtR; 44 | TEdit *edtS; 45 | TGroupBox *GroupBox4; 46 | TMemo *mmoMsg; 47 | TLbDSA *LbDSA1; 48 | TMainMenu *mnuMain; 49 | TMenuItem *mnuFile; 50 | TMenuItem *mnuFileOpen; 51 | TMenuItem *mnuFileSign; 52 | TMenuItem *mnuFileVerify; 53 | TMenuItem *mnuFileClose; 54 | TMenuItem *N1; 55 | TMenuItem *mnuFileExit; 56 | TMenuItem *mnuDSAKeys; 57 | TMenuItem *mnuDSAKeysGenerate; 58 | TMenuItem *mnuDSAKeysPub; 59 | TMenuItem *mnuDSAKeysPubSave; 60 | TMenuItem *mnuDSAKeysPubLoad; 61 | TMenuItem *mnuDSAKeysPubClear; 62 | TMenuItem *mnuDSAKeysPri; 63 | TMenuItem *mnuDSAKeysPriSave; 64 | TMenuItem *mnuDSAKeysPriLoad; 65 | TMenuItem *mnuDSAKeysPriClear; 66 | TOpenDialog *dlgOpenTxt; 67 | TOpenDialog *dlgOpenASN; 68 | TSaveDialog *dlgSaveASN; 69 | void __fastcall mnuFileOpenClick(TObject *Sender); 70 | void __fastcall mnuFileSignClick(TObject *Sender); 71 | void __fastcall mnuFileVerifyClick(TObject *Sender); 72 | void __fastcall mnuFileCloseClick(TObject *Sender); 73 | void __fastcall mnuFileExitClick(TObject *Sender); 74 | void __fastcall mnuDSAKeysGenerateClick(TObject *Sender); 75 | void __fastcall mnuDSAKeysPubSaveClick(TObject *Sender); 76 | void __fastcall mnuDSAKeysPriSaveClick(TObject *Sender); 77 | void __fastcall mnuDSAKeysPubLoadClick(TObject *Sender); 78 | void __fastcall mnuDSAKeysPriLoadClick(TObject *Sender); 79 | void __fastcall mnuDSAKeysPubClearClick(TObject *Sender); 80 | void __fastcall mnuDSAKeysPriClearClick(TObject *Sender); 81 | void __fastcall LbDSA1GetR(TObject *Sender, TLbDSABlock &Block); 82 | void __fastcall LbDSA1GetS(TObject *Sender, TLbDSABlock &Block); 83 | void __fastcall LbDSA1Progress(TObject *Sender, bool &Abort); 84 | private: // User declarations 85 | void __fastcall UpdatePrivateKeyFields(); 86 | void __fastcall UpdatePublicKeyFields(); 87 | public: // User declarations 88 | __fastcall TfrmDSASig(TComponent* Owner); 89 | }; 90 | //--------------------------------------------------------------------------- 91 | extern PACKAGE TfrmDSASig *frmDSASig; 92 | //--------------------------------------------------------------------------- 93 | #endif 94 | -------------------------------------------------------------------------------- /packages/L207_r51.bpk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | [Version Info] 51 | IncludeVerInfo=1 52 | AutoIncBuild=0 53 | MajorVer=2 54 | MinorVer=0 55 | Release=7 56 | Build=0 57 | Debug=0 58 | PreRelease=0 59 | Special=0 60 | Private=0 61 | DLL=0 62 | Locale=1033 63 | CodePage=1252 64 | 65 | [Version Info Keys] 66 | CompanyName=TurboPower Software 67 | FileDescription=LockBox Components 68 | FileVersion=2.0.7.0 69 | InternalName= 70 | LegalCopyright=Copyright (c) TurboPower Software Co 1997-2002 71 | LegalTrademarks= 72 | OriginalFilename= 73 | ProductName=LockBox 74 | ProductVersion=2.07 75 | Comments= 76 | 77 | [HistoryLists\hlIncludePath] 78 | Count=2 79 | Item0=..\source;$(BCB)\include;$(BCB)\include\vcl 80 | Item1=$(BCB)\include;$(BCB)\include\vcl 81 | 82 | [HistoryLists\hlLibraryPath] 83 | Count=4 84 | Item0=..\source;$(BCB)\lib\obj;$(BCB)\lib 85 | Item1=$(BCB)\lib\obj;$(BCB)\lib 86 | Item2=C:\Abbrevia\;$(BCB)\lib\obj;$(BCB)\lib 87 | Item3=C:\Abbrevia;$(BCB)\lib\obj;$(BCB)\lib 88 | 89 | [HistoryLists\hlDebugSourcePath] 90 | Count=1 91 | Item0=$(BCB)\source\vcl 92 | 93 | [Debugging] 94 | DebugSourceDirs=$(BCB)\source\vcl 95 | 96 | [Parameters] 97 | RunParams= 98 | HostApplication= 99 | RemoteHost= 100 | RemotePath= 101 | RemoteDebug=0 102 | 103 | [Compiler] 104 | ShowInfoMsgs=0 105 | LinkDebugVcl=0 106 | LinkCGLIB=0 107 | 108 | [CORBA] 109 | AddServerUnit=1 110 | AddClientUnit=1 111 | PrecompiledHeaders=1 112 | 113 | [Language] 114 | ActiveLang= 115 | ProjectLang= 116 | RootDir= 117 | 118 | -------------------------------------------------------------------------------- /examples/Delphi/ExStrin1.pas: -------------------------------------------------------------------------------- 1 | unit ExStrin1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | {$ENDIF} 15 | {$IFDEF LINUX} 16 | QForms, 17 | QStdCtrls, 18 | QControls, 19 | {$ENDIF} 20 | SysUtils, 21 | Classes; 22 | 23 | type 24 | TForm1 = class(TForm) 25 | btnEncrypt: TButton; 26 | btnDecrypt: TButton; 27 | Label4: TLabel; 28 | cbxEncryption: TComboBox; 29 | mmoPlainText1: TMemo; 30 | Label5: TLabel; 31 | mmoCipherText: TMemo; 32 | Label7: TLabel; 33 | mmoPlainText2: TMemo; 34 | Label6: TLabel; 35 | Label1: TLabel; 36 | edtPassphrase: TEdit; 37 | procedure btnEncryptClick(Sender: TObject); 38 | procedure btnDecryptClick(Sender: TObject); 39 | procedure FormCreate(Sender: TObject); 40 | private 41 | procedure RefreshKeys; 42 | public 43 | { Public declarations } 44 | end; 45 | 46 | var 47 | Form1: TForm1; 48 | 49 | implementation 50 | 51 | {$R *.dfm} 52 | 53 | uses 54 | LbCipher, LbString; 55 | 56 | type 57 | TEncryption = (eBf, eBfCbc, eDes, eDesCbc, e3Des, e3DesCbc, eRdl, eRdlCbc); 58 | 59 | 60 | var 61 | Key64 : TKey64; 62 | Key128 : TKey128; 63 | Key192 : TKey192; 64 | Key256 : TKey256; 65 | PlainText : string; 66 | CipherText : string; 67 | 68 | procedure TForm1.FormCreate(Sender: TObject); 69 | begin 70 | cbxEncryption.ItemIndex := Integer(eDes); 71 | end; 72 | 73 | procedure TForm1.btnEncryptClick(Sender: TObject); 74 | begin 75 | RefreshKeys; 76 | PlainText := mmoPlainText1.Text; 77 | case TEncryption(cbxEncryption.ItemIndex) of 78 | eBf : CipherText := BFEncryptStringEx(PlainText, Key128, True); 79 | eBfCbc : CipherText := BFEncryptStringCBCEx(PlainText, Key128, True); 80 | eDes : CipherText := DESEncryptStringEx(PlainText, Key64, True); 81 | eDesCbc : CipherText := DESEncryptStringCBCEx(PlainText, Key64, True); 82 | e3Des : CipherText := TripleDESEncryptStringEx(PlainText, Key128, True); 83 | e3DesCbc : CipherText := TripleDESEncryptStringCBCEx(PlainText, Key128, True); 84 | eRdl : CipherText := RDLEncryptStringEx(PlainText, Key128, 16, True); 85 | eRdlCbc : CipherText := RDLEncryptStringCBCEx(PlainText, Key128, 16, True); 86 | end; 87 | mmoCipherText.Text := CipherText; 88 | mmoPlainText2.Clear; 89 | end; 90 | 91 | procedure TForm1.btnDecryptClick(Sender: TObject); 92 | begin 93 | RefreshKeys; 94 | CipherText := mmoCipherText.Text; 95 | case TEncryption(cbxEncryption.ItemIndex) of 96 | eBf : PlainText := BFEncryptStringEx(CipherText, Key128, False); 97 | eBfCbc : PlainText := BFEncryptStringCBCEx(CipherText, Key128, False); 98 | eDes : PlainText := DESEncryptStringEx(CipherText, Key64, False); 99 | eDesCbc : PlainText := DESEncryptStringCBCEx(CipherText, Key64, False); 100 | e3Des : PlainText := TripleDESEncryptStringEx(CipherText, Key128, False); 101 | e3DesCbc : PlainText := TripleDESEncryptStringCBCEx(CipherText, Key128, False); 102 | eRdl : PlainText := RDLEncryptStringEx(CipherText, Key128, 16, False); 103 | eRdlCbc : PlainText := RDLEncryptStringCBCEx(CipherText, Key128, 16, False); 104 | end; 105 | mmoPlainText2.Text := PlainText; 106 | end; 107 | 108 | procedure TForm1.RefreshKeys; 109 | begin 110 | GenerateLMDKey(Key64, SizeOf(Key64), edtPassphrase.Text); 111 | GenerateLMDKey(Key128, SizeOf(Key128), edtPassphrase.Text); 112 | GenerateLMDKey(Key192, SizeOf(Key192), edtPassphrase.Text); 113 | GenerateLMDKey(Key256, SizeOf(Key256), edtPassphrase.Text); 114 | end; 115 | 116 | 117 | end. 118 | -------------------------------------------------------------------------------- /examples/Kylix/ExStrin1.pas: -------------------------------------------------------------------------------- 1 | unit ExStrin1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | {$ENDIF} 15 | {$IFDEF LINUX} 16 | QForms, 17 | QStdCtrls, 18 | QControls, 19 | {$ENDIF} 20 | SysUtils, 21 | Classes; 22 | 23 | type 24 | TForm1 = class(TForm) 25 | btnEncrypt: TButton; 26 | btnDecrypt: TButton; 27 | Label4: TLabel; 28 | cbxEncryption: TComboBox; 29 | mmoPlainText1: TMemo; 30 | Label5: TLabel; 31 | mmoCipherText: TMemo; 32 | Label7: TLabel; 33 | mmoPlainText2: TMemo; 34 | Label6: TLabel; 35 | Label1: TLabel; 36 | edtPassphrase: TEdit; 37 | procedure btnEncryptClick(Sender: TObject); 38 | procedure btnDecryptClick(Sender: TObject); 39 | procedure FormCreate(Sender: TObject); 40 | private 41 | procedure RefreshKeys; 42 | public 43 | { Public declarations } 44 | end; 45 | 46 | var 47 | Form1: TForm1; 48 | 49 | implementation 50 | 51 | {$R *.dfm} 52 | 53 | uses 54 | LbCipher, LbString; 55 | 56 | type 57 | TEncryption = (eBf, eBfCbc, eDes, eDesCbc, e3Des, e3DesCbc, eRdl, eRdlCbc); 58 | 59 | 60 | var 61 | Key64 : TKey64; 62 | Key128 : TKey128; 63 | Key192 : TKey192; 64 | Key256 : TKey256; 65 | PlainText : string; 66 | CipherText : string; 67 | 68 | procedure TForm1.FormCreate(Sender: TObject); 69 | begin 70 | cbxEncryption.ItemIndex := Integer(eDes); 71 | end; 72 | 73 | procedure TForm1.btnEncryptClick(Sender: TObject); 74 | begin 75 | RefreshKeys; 76 | PlainText := mmoPlainText1.Text; 77 | case TEncryption(cbxEncryption.ItemIndex) of 78 | eBf : CipherText := BFEncryptStringEx(PlainText, Key128, True); 79 | eBfCbc : CipherText := BFEncryptStringCBCEx(PlainText, Key128, True); 80 | eDes : CipherText := DESEncryptStringEx(PlainText, Key64, True); 81 | eDesCbc : CipherText := DESEncryptStringCBCEx(PlainText, Key64, True); 82 | e3Des : CipherText := TripleDESEncryptStringEx(PlainText, Key128, True); 83 | e3DesCbc : CipherText := TripleDESEncryptStringCBCEx(PlainText, Key128, True); 84 | eRdl : CipherText := RDLEncryptStringEx(PlainText, Key128, 16, True); 85 | eRdlCbc : CipherText := RDLEncryptStringCBCEx(PlainText, Key128, 16, True); 86 | end; 87 | mmoCipherText.Text := CipherText; 88 | mmoPlainText2.Clear; 89 | end; 90 | 91 | procedure TForm1.btnDecryptClick(Sender: TObject); 92 | begin 93 | RefreshKeys; 94 | CipherText := mmoCipherText.Text; 95 | case TEncryption(cbxEncryption.ItemIndex) of 96 | eBf : PlainText := BFEncryptStringEx(CipherText, Key128, False); 97 | eBfCbc : PlainText := BFEncryptStringCBCEx(CipherText, Key128, False); 98 | eDes : PlainText := DESEncryptStringEx(CipherText, Key64, False); 99 | eDesCbc : PlainText := DESEncryptStringCBCEx(CipherText, Key64, False); 100 | e3Des : PlainText := TripleDESEncryptStringEx(CipherText, Key128, False); 101 | e3DesCbc : PlainText := TripleDESEncryptStringCBCEx(CipherText, Key128, False); 102 | eRdl : PlainText := RDLEncryptStringEx(CipherText, Key128, 16, False); 103 | eRdlCbc : PlainText := RDLEncryptStringCBCEx(CipherText, Key128, 16, False); 104 | end; 105 | mmoPlainText2.Text := PlainText; 106 | end; 107 | 108 | procedure TForm1.RefreshKeys; 109 | begin 110 | GenerateLMDKey(Key64, SizeOf(Key64), edtPassphrase.Text); 111 | GenerateLMDKey(Key128, SizeOf(Key128), edtPassphrase.Text); 112 | GenerateLMDKey(Key192, SizeOf(Key192), edtPassphrase.Text); 113 | GenerateLMDKey(Key256, SizeOf(Key256), edtPassphrase.Text); 114 | end; 115 | 116 | 117 | end. 118 | -------------------------------------------------------------------------------- /packages/L207_d51.bpk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | [Version Info] 50 | IncludeVerInfo=1 51 | AutoIncBuild=0 52 | MajorVer=2 53 | MinorVer=0 54 | Release=7 55 | Build=0 56 | Debug=0 57 | PreRelease=0 58 | Special=0 59 | Private=0 60 | DLL=0 61 | Locale=1033 62 | CodePage=1252 63 | 64 | [Version Info Keys] 65 | CompanyName=TurboPower Software 66 | FileDescription=LockBox Components 67 | FileVersion=2.0.7.0 68 | InternalName= 69 | LegalCopyright=Copyright (c) TurboPower Software Co 1997-2002 70 | LegalTrademarks= 71 | OriginalFilename= 72 | ProductName=LockBox 73 | ProductVersion=2.07 74 | Comments= 75 | 76 | [HistoryLists\hlIncludePath] 77 | Count=2 78 | Item0=..\source;$(BCB)\include;$(BCB)\include\vcl 79 | Item1=$(BCB)\include;$(BCB)\include\vcl 80 | 81 | [HistoryLists\hlLibraryPath] 82 | Count=7 83 | Item0=..\source;;$(BCB)\lib\obj;$(BCB)\lib 84 | Item1=;$(BCB)\lib\obj;$(BCB)\lib 85 | Item2=$(BCB)\lib\obj;$(BCB)\lib 86 | Item3=;C:\Abbrevia\;$(BCB)\lib\obj;$(BCB)\lib 87 | Item4=C:\Abbrevia\;$(BCB)\lib\obj;$(BCB)\lib 88 | Item5=;;;$(BCB)\lib\obj;$(BCB)\lib 89 | Item6=..\lockbox2;$(BCB)\lib\obj;$(BCB)\lib 90 | 91 | [HistoryLists\hlDebugSourcePath] 92 | Count=1 93 | Item0=$(BCB)\source\vcl 94 | 95 | [HistoryLists\hlConditionals] 96 | Count=1 97 | Item0=_RTLDLL;USEPACKAGES 98 | 99 | [Debugging] 100 | DebugSourceDirs=$(BCB)\source\vcl 101 | 102 | [Parameters] 103 | RunParams= 104 | HostApplication= 105 | RemoteHost= 106 | RemotePath= 107 | RemoteDebug=0 108 | 109 | [Compiler] 110 | ShowInfoMsgs=0 111 | LinkDebugVcl=0 112 | LinkCGLIB=0 113 | 114 | [CORBA] 115 | AddServerUnit=1 116 | AddClientUnit=1 117 | PrecompiledHeaders=1 118 | 119 | [Language] 120 | ActiveLang= 121 | ProjectLang= 122 | RootDir= 123 | 124 | -------------------------------------------------------------------------------- /source/LockBox.inc: -------------------------------------------------------------------------------- 1 | (* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is TurboPower LockBox 15 | * 16 | * The Initial Developer of the Original Code is 17 | * TurboPower Software 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 1997-2002 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * ***** END LICENSE BLOCK ***** *) 25 | {*********************************************************} 26 | {* LOCKBOX.INC 2.07 *} 27 | {* Copyright (c) 2002 TurboPower Software Co *} 28 | {* All rights reserved. *} 29 | {*********************************************************} 30 | 31 | {Conditional defines that affect compilation} 32 | 33 | {$IFDEF VER80} { Delphi 1 } 34 | !!! LockBox 2.0 does not support Delphi 1 35 | {$ENDIF} 36 | 37 | {$IFDEF VER93} { C++ Builder 1 } 38 | !!! LockBox 2.0 does not support C++Builder 1 39 | {$ENDIF} 40 | 41 | {$IFNDEF VER90} { Delphi 2 } 42 | {$DEFINE VERSION3} { for Delphi 3.0 or BCB 3.0 or higher } 43 | {$ENDIF} 44 | 45 | {$IFDEF VER110} { C++ Builder 3 } 46 | {$DEFINE CBuilder} 47 | {$ObjExportAll On} 48 | {$ENDIF} 49 | 50 | {$IFDEF VER125} { C++ Builder 4 } 51 | {$DEFINE CBuilder} 52 | {$ObjExportAll On} 53 | {$ENDIF} 54 | 55 | {$IFDEF VER130} { Delphi 5 & C++ Builder 5 } 56 | {$IFDEF BCB} { C++ Builder 5 } 57 | {$DEFINE CBuilder} 58 | {$ObjExportAll On} 59 | {$ENDIF} 60 | {$ENDIF} 61 | 62 | {$IFDEF VERSION3} 63 | {$IFNDEF VER100} { Delphi 3 } 64 | {$IFNDEF VER110} { BCB 3 } 65 | {$DEFINE VERSION4} { Delphi 4.0 or higher } 66 | {$ENDIF} 67 | {$ENDIF} 68 | {$ENDIF} 69 | 70 | {$IFDEF VERSION4} 71 | {$IFNDEF VER120} { Delphi 4 } 72 | {$IFNDEF VER125} { BCB 4 } 73 | {$DEFINE VERSION5} { Delphi 5.0 or higher } 74 | {$ENDIF} 75 | {$ENDIF} 76 | {$ENDIF} 77 | 78 | {$IFDEF VERSION3} 79 | {$IFNDEF VERSION4} 80 | {$DEFINE VERSION3ONLY} 81 | {$ENDIF} 82 | {$ENDIF} 83 | 84 | {$IFDEF VERSION3} 85 | {$IFDEF VER140} 86 | {$DEFINE VERSION6} { Delphi 6.0 or higher } 87 | {$DEFINE USEDESIGNIDE} 88 | {$ENDIF} 89 | {$ENDIF} 90 | 91 | {$IFDEF VER150} { Delphi 7 } 92 | {$DEFINE VERSION6} { Version 6 or greater } 93 | {$DEFINE VERSION7} 94 | {$IFDEF BCB} 95 | {$DEFINE CBuilder} 96 | {$ObjExportAll On} 97 | {$ENDIF} 98 | {$ENDIF} 99 | 100 | 101 | 102 | { determine whether CLX is used, should always be on Linux } 103 | {$IFDEF LINUX} 104 | {$DEFINE UsingCLX } 105 | {$ENDIF LINUX} 106 | 107 | {$IFNDEF MSWINDOWS} 108 | {$IFDEF VERSION3} 109 | {$IFNDEF LINUX} 110 | {$DEFINE MSWINDOWS} 111 | {$ENDIF} 112 | {$ENDIF} 113 | {$ENDIF MSWINDOWS} 114 | 115 | 116 | 117 | 118 | 119 | {$A+} {Word Align Data} 120 | {$Q-} {Overflow Checking} 121 | {$R-} {Range-Checking} 122 | {$S-} {Stack-Overflow Checking} 123 | {$V-} {Var-String Checking} 124 | {$B-} {Complete Boolean Evaluation} 125 | {$I+} {Input/Output-Checking} 126 | {$P+} {Open Parameters} 127 | {$T-} {Typed @ Operator} 128 | {$W-} {Windows Stack Frame} 129 | {$X+} {Extended Syntax} 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /examples/CBuilder/DSAKeys1.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | 5 | #include "DSAKeys1.h" 6 | //--------------------------------------------------------------------------- 7 | #pragma package(smart_init) 8 | #pragma link "LbAsym" 9 | #pragma link "LbCipher" 10 | #pragma link "LbClass" 11 | #pragma link "LbDSA" 12 | #pragma resource "*.dfm" 13 | TfrmDSAKeys *frmDSAKeys; 14 | //--------------------------------------------------------------------------- 15 | __fastcall TfrmDSAKeys::TfrmDSAKeys(TComponent* Owner) 16 | : TForm(Owner) 17 | { 18 | } 19 | //--------------------------------------------------------------------------- 20 | void __fastcall TfrmDSAKeys::UpdatePrivateKeyFields() 21 | { 22 | edtPriQ->Text = LbDSA1->PrivateKey->QAsString; 23 | mmoPriP->Lines->Text = LbDSA1->PrivateKey->PAsString; 24 | mmoPriG->Lines->Text = LbDSA1->PrivateKey->GAsString; 25 | edtPriX->Text = LbDSA1->PrivateKey->XAsString; 26 | } 27 | //--------------------------------------------------------------------------- 28 | void __fastcall TfrmDSAKeys::UpdatePublicKeyFields() 29 | { 30 | edtPubQ->Text = LbDSA1->PublicKey->QAsString; 31 | mmoPubP->Lines->Text = LbDSA1->PublicKey->PAsString; 32 | mmoPubG->Lines->Text = LbDSA1->PublicKey->GAsString; 33 | mmoPubY->Lines->Text = LbDSA1->PublicKey->YAsString; 34 | } 35 | //--------------------------------------------------------------------------- 36 | 37 | void __fastcall TfrmDSAKeys::btnCreateKeysClick(TObject *Sender) 38 | { 39 | Screen->Cursor = crHourGlass; 40 | StatusBar1->SimpleText = "Generating key pair, this may take a while"; 41 | try 42 | { 43 | LbDSA1->PrimeTestIterations = (unsigned char) StrToIntDef(edtIterations->Text, 20); 44 | LbDSA1->KeySize = TLbAsymKeySize(cbxKeySize->ItemIndex); 45 | LbDSA1->GenerateKeyPair(); 46 | UpdatePrivateKeyFields(); 47 | UpdatePublicKeyFields(); 48 | } 49 | __finally 50 | { 51 | Screen->Cursor = crDefault; 52 | StatusBar1->SimpleText = ""; 53 | } 54 | } 55 | //--------------------------------------------------------------------------- 56 | void __fastcall TfrmDSAKeys::btnLoadPublicClick(TObject *Sender) 57 | { 58 | if (dlgOpenASN->Execute()) 59 | { 60 | LbDSA1->PublicKey->Passphrase = edtPublicPhrase->Text; 61 | LbDSA1->PublicKey->LoadFromFile(dlgOpenASN->FileName); 62 | UpdatePublicKeyFields(); 63 | } 64 | } 65 | //--------------------------------------------------------------------------- 66 | void __fastcall TfrmDSAKeys::btnSavePublicClick(TObject *Sender) 67 | { 68 | if (dlgSaveASN->Execute()) 69 | { 70 | LbDSA1->PublicKey->Passphrase = edtPublicPhrase->Text; 71 | LbDSA1->PublicKey->StoreToFile(dlgSaveASN->FileName); 72 | } 73 | } 74 | //--------------------------------------------------------------------------- 75 | void __fastcall TfrmDSAKeys::btnLoadPrivateClick(TObject *Sender) 76 | { 77 | if (dlgOpenASN->Execute()) 78 | { 79 | LbDSA1->PrivateKey->Passphrase = edtPrivatePhrase->Text; 80 | LbDSA1->PrivateKey->LoadFromFile(dlgOpenASN->FileName); 81 | UpdatePrivateKeyFields(); 82 | } 83 | } 84 | //--------------------------------------------------------------------------- 85 | void __fastcall TfrmDSAKeys::btnSavePrivateClick(TObject *Sender) 86 | { 87 | if (dlgSaveASN->Execute()) 88 | { 89 | LbDSA1->PrivateKey->Passphrase = edtPrivatePhrase->Text; 90 | LbDSA1->PrivateKey->StoreToFile(dlgSaveASN->FileName); 91 | } 92 | } 93 | //--------------------------------------------------------------------------- 94 | void __fastcall TfrmDSAKeys::btnClearClick(TObject *Sender) 95 | { 96 | LbDSA1->PublicKey->Clear(); 97 | LbDSA1->PrivateKey->Clear(); 98 | UpdatePublicKeyFields(); 99 | UpdatePrivateKeyFields(); 100 | } 101 | //--------------------------------------------------------------------------- 102 | void __fastcall TfrmDSAKeys::FormCreate(TObject *Sender) 103 | { 104 | cbxKeySize->ItemIndex = (int) LbDSA1->KeySize; 105 | } 106 | //--------------------------------------------------------------------------- 107 | -------------------------------------------------------------------------------- /examples/Delphi/RSASSA1.pas: -------------------------------------------------------------------------------- 1 | unit RSASSA1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | ExtCtrls, 15 | ComCtrls, 16 | {$ENDIF} 17 | {$IFDEF LINUX} 18 | QForms, 19 | QStdCtrls, 20 | QControls, 21 | QExtCtrls, 22 | QComCtrls, 23 | {$ENDIF} 24 | SysUtils, 25 | Classes, 26 | LbCipher, 27 | LbClass, 28 | LbAsym, 29 | LbRSA; 30 | 31 | type 32 | TForm1 = class(TForm) 33 | LbRSASSA1: TLbRSASSA; 34 | StatusBar1: TStatusBar; 35 | Label1: TLabel; 36 | mmoSignature: TMemo; 37 | GroupBox1: TGroupBox; 38 | Label2: TLabel; 39 | cbxKeySize: TComboBox; 40 | btnGenKeys: TButton; 41 | Label4: TLabel; 42 | edtMsg: TEdit; 43 | btnSign: TButton; 44 | btnVerify: TButton; 45 | Label3: TLabel; 46 | cbxHashMethod: TComboBox; 47 | chkAbort: TCheckBox; 48 | procedure btnSignClick(Sender: TObject); 49 | procedure FormCreate(Sender: TObject); 50 | procedure btnGenKeysClick(Sender: TObject); 51 | procedure btnVerifyClick(Sender: TObject); 52 | procedure cbxKeySizeChange(Sender: TObject); 53 | procedure cbxHashMethodChange(Sender: TObject); 54 | procedure LbRSASSA1GetSignature(Sender: TObject; 55 | var Sig: TRSASignatureBlock); 56 | procedure LbRSASSA1Progress(Sender: TObject; var Abort: Boolean); 57 | private 58 | { Private declarations } 59 | public 60 | { Public declarations } 61 | end; 62 | 63 | var 64 | Form1: TForm1; 65 | 66 | implementation 67 | 68 | {$R *.dfm} 69 | 70 | uses 71 | LbUtils; 72 | 73 | const 74 | sPass = ' Signature verification: PASSED'; 75 | sFail = ' Signature verification: FAILED'; 76 | sSigning = ' Generating signature'; 77 | sPatience = ' Generating RSA key pair- this may take a while'; 78 | sAbort = ' Key generation aborted'; 79 | 80 | procedure TForm1.FormCreate(Sender: TObject); 81 | { initialize edit controls } 82 | begin 83 | cbxHashMethod.ItemIndex := Ord(LbRSASSA1.HashMethod); 84 | cbxKeySize.ItemIndex := Ord(LbRSASSA1.KeySize) - 1; 85 | end; 86 | 87 | procedure TForm1.btnGenKeysClick(Sender: TObject); 88 | { generate RSA key pair } 89 | begin 90 | Screen.Cursor := crAppStart; 91 | StatusBar1.SimpleText := sPatience; 92 | try 93 | LbRSASSA1.GenerateKeyPair; 94 | finally 95 | Screen.Cursor := crDefault; 96 | if chkAbort.Checked then 97 | StatusBar1.SimpleText := sAbort 98 | else 99 | StatusBar1.SimpleText := ''; 100 | end; 101 | end; 102 | 103 | procedure TForm1.btnSignClick(Sender: TObject); 104 | { sign message string, display signature as hex string } 105 | begin 106 | Screen.Cursor := crHourglass; 107 | StatusBar1.SimpleText := sSigning; 108 | try 109 | LbRSASSA1.SignString(edtMsg.Text); 110 | mmoSignature.Text := LbRSASSA1.Signature.IntStr; 111 | finally 112 | Screen.Cursor := crDefault; 113 | StatusBar1.SimpleText := ''; 114 | end; 115 | end; 116 | 117 | procedure TForm1.btnVerifyClick(Sender: TObject); 118 | { verify signature against message } 119 | begin 120 | if LbRSASSA1.VerifyString(edtMsg.Text) then 121 | StatusBar1.SimpleText := sPass 122 | else 123 | StatusBar1.SimpleText := sFail; 124 | end; 125 | 126 | procedure TForm1.LbRSASSA1GetSignature(Sender: TObject; 127 | var Sig: TRSASignatureBlock); 128 | { convert signature string to binary and return it } 129 | begin 130 | HexToBuffer(mmoSignature.Text, Sig, SizeOf(Sig)); 131 | end; 132 | 133 | procedure TForm1.cbxKeySizeChange(Sender: TObject); 134 | { key size changed } 135 | begin 136 | LbRSASSA1.KeySize := TLbAsymKeySize(cbxKeySize.ItemIndex + 1); 137 | end; 138 | 139 | procedure TForm1.cbxHashMethodChange(Sender: TObject); 140 | { hash method changed } 141 | begin 142 | LbRSASSA1.HashMethod := TRSAHashMethod(cbxHashMethod.ItemIndex); 143 | end; 144 | 145 | procedure TForm1.LbRSASSA1Progress(Sender: TObject; var Abort: Boolean); 146 | { process message loop and abort if need be } 147 | begin 148 | Application.ProcessMessages; 149 | Abort := chkAbort.Checked; 150 | end; 151 | 152 | end. 153 | -------------------------------------------------------------------------------- /examples/Kylix/RSASSA1.pas: -------------------------------------------------------------------------------- 1 | unit RSASSA1; 2 | 3 | interface 4 | 5 | uses 6 | {$IFDEF WIN32} 7 | Windows, 8 | Messages, 9 | Graphics, 10 | Controls, 11 | Forms, 12 | Dialogs, 13 | StdCtrls, 14 | ExtCtrls, 15 | ComCtrls, 16 | {$ENDIF} 17 | {$IFDEF LINUX} 18 | QForms, 19 | QStdCtrls, 20 | QControls, 21 | QExtCtrls, 22 | QComCtrls, 23 | {$ENDIF} 24 | SysUtils, 25 | Classes, 26 | LbCipher, 27 | LbClass, 28 | LbAsym, 29 | LbRSA; 30 | 31 | type 32 | TForm1 = class(TForm) 33 | LbRSASSA1: TLbRSASSA; 34 | StatusBar1: TStatusBar; 35 | Label1: TLabel; 36 | mmoSignature: TMemo; 37 | GroupBox1: TGroupBox; 38 | Label2: TLabel; 39 | cbxKeySize: TComboBox; 40 | btnGenKeys: TButton; 41 | Label4: TLabel; 42 | edtMsg: TEdit; 43 | btnSign: TButton; 44 | btnVerify: TButton; 45 | Label3: TLabel; 46 | cbxHashMethod: TComboBox; 47 | chkAbort: TCheckBox; 48 | procedure btnSignClick(Sender: TObject); 49 | procedure FormCreate(Sender: TObject); 50 | procedure btnGenKeysClick(Sender: TObject); 51 | procedure btnVerifyClick(Sender: TObject); 52 | procedure cbxKeySizeChange(Sender: TObject); 53 | procedure cbxHashMethodChange(Sender: TObject); 54 | procedure LbRSASSA1GetSignature(Sender: TObject; 55 | var Sig: TRSASignatureBlock); 56 | procedure LbRSASSA1Progress(Sender: TObject; var Abort: Boolean); 57 | private 58 | { Private declarations } 59 | public 60 | { Public declarations } 61 | end; 62 | 63 | var 64 | Form1: TForm1; 65 | 66 | implementation 67 | 68 | {$R *.dfm} 69 | 70 | uses 71 | LbUtils; 72 | 73 | const 74 | sPass = ' Signature verification: PASSED'; 75 | sFail = ' Signature verification: FAILED'; 76 | sSigning = ' Generating signature'; 77 | sPatience = ' Generating RSA key pair- this may take a while'; 78 | sAbort = ' Key generation aborted'; 79 | 80 | procedure TForm1.FormCreate(Sender: TObject); 81 | { initialize edit controls } 82 | begin 83 | cbxHashMethod.ItemIndex := Ord(LbRSASSA1.HashMethod); 84 | cbxKeySize.ItemIndex := Ord(LbRSASSA1.KeySize) - 1; 85 | end; 86 | 87 | procedure TForm1.btnGenKeysClick(Sender: TObject); 88 | { generate RSA key pair } 89 | begin 90 | Screen.Cursor := crAppStart; 91 | StatusBar1.SimpleText := sPatience; 92 | try 93 | LbRSASSA1.GenerateKeyPair; 94 | finally 95 | Screen.Cursor := crDefault; 96 | if chkAbort.Checked then 97 | StatusBar1.SimpleText := sAbort 98 | else 99 | StatusBar1.SimpleText := ''; 100 | end; 101 | end; 102 | 103 | procedure TForm1.btnSignClick(Sender: TObject); 104 | { sign message string, display signature as hex string } 105 | begin 106 | Screen.Cursor := crHourglass; 107 | StatusBar1.SimpleText := sSigning; 108 | try 109 | LbRSASSA1.SignString(edtMsg.Text); 110 | mmoSignature.Text := LbRSASSA1.Signature.IntStr; 111 | finally 112 | Screen.Cursor := crDefault; 113 | StatusBar1.SimpleText := ''; 114 | end; 115 | end; 116 | 117 | procedure TForm1.btnVerifyClick(Sender: TObject); 118 | { verify signature against message } 119 | begin 120 | if LbRSASSA1.VerifyString(edtMsg.Text) then 121 | StatusBar1.SimpleText := sPass 122 | else 123 | StatusBar1.SimpleText := sFail; 124 | end; 125 | 126 | procedure TForm1.LbRSASSA1GetSignature(Sender: TObject; 127 | var Sig: TRSASignatureBlock); 128 | { convert signature string to binary and return it } 129 | begin 130 | HexToBuffer(mmoSignature.Text, Sig, SizeOf(Sig)); 131 | end; 132 | 133 | procedure TForm1.cbxKeySizeChange(Sender: TObject); 134 | { key size changed } 135 | begin 136 | LbRSASSA1.KeySize := TLbAsymKeySize(cbxKeySize.ItemIndex + 1); 137 | end; 138 | 139 | procedure TForm1.cbxHashMethodChange(Sender: TObject); 140 | { hash method changed } 141 | begin 142 | LbRSASSA1.HashMethod := TRSAHashMethod(cbxHashMethod.ItemIndex); 143 | end; 144 | 145 | procedure TForm1.LbRSASSA1Progress(Sender: TObject; var Abort: Boolean); 146 | { process message loop and abort if need be } 147 | begin 148 | Application.ProcessMessages; 149 | Abort := chkAbort.Checked; 150 | end; 151 | 152 | end. 153 | -------------------------------------------------------------------------------- /examples/CBuilder/ExStrin1.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | #pragma hdrstop 4 | 5 | #include "ExStrin1.h" 6 | #pragma link "LbCipher.obj" 7 | #pragma link "LbString.obj" 8 | //--------------------------------------------------------------------------- 9 | #pragma package(smart_init) 10 | #pragma resource "*.dfm" 11 | TForm1 *Form1; 12 | 13 | TKey64 Key64; 14 | TKey128 Key128; 15 | TKey192 Key192; 16 | TKey256 Key256; 17 | AnsiString PlainText; 18 | AnsiString CipherText; 19 | 20 | enum TEncryption { eBf, eBfCbc, eDes, eDesCbc, e3Des, e3DesCbc, 21 | eLbc, eLbcCbc, eRdl, eRdlCbc }; 22 | 23 | //--------------------------------------------------------------------------- 24 | __fastcall TForm1::TForm1(TComponent* Owner) 25 | : TForm(Owner) 26 | { 27 | } 28 | //--------------------------------------------------------------------------- 29 | void __fastcall TForm1::FormCreate(TObject *Sender) 30 | { 31 | cbxCipher->ItemIndex = (int) eDes; 32 | } 33 | //--------------------------------------------------------------------------- 34 | void __fastcall TForm1::btnEncryptClick(TObject *Sender) 35 | { 36 | Screen->Cursor = crHourGlass; 37 | GenerateLMDKey(Key64, sizeof(Key64), edtPassphrase->Text); 38 | GenerateLMDKey(Key128, sizeof(Key128), edtPassphrase->Text); 39 | GenerateLMDKey(Key192, sizeof(Key192), edtPassphrase->Text); 40 | GenerateLMDKey(Key256, sizeof(Key256), edtPassphrase->Text); 41 | PlainText = mmoPlainText1->Text; 42 | try { 43 | switch ((TEncryption) cbxCipher->ItemIndex) { 44 | case eBf : CipherText = BFEncryptStringEx(PlainText, Key128, true); 45 | break; 46 | case eBfCbc : CipherText = BFEncryptStringCBCEx(PlainText, Key128, true); 47 | break; 48 | case eDes : CipherText = DESEncryptStringEx(PlainText, Key64, true); 49 | break; 50 | case eDesCbc : CipherText = DESEncryptStringCBCEx(PlainText, Key64, true); 51 | break; 52 | case e3Des : CipherText = TripleDESEncryptStringEx(PlainText, Key128, true); 53 | break; 54 | case e3DesCbc : CipherText = TripleDESEncryptStringCBCEx(PlainText, Key128, true); 55 | break; 56 | case eRdl : CipherText = RDLEncryptStringEx(PlainText, Key128, 16, true); 57 | break; 58 | case eRdlCbc : CipherText = RDLEncryptStringCBCEx(PlainText, Key128, 16, true); 59 | break; 60 | } 61 | mmoCipherText->Text = CipherText; 62 | } 63 | catch (...) { 64 | } // swallow any errors 65 | Screen->Cursor = crDefault; 66 | } 67 | //--------------------------------------------------------------------------- 68 | void __fastcall TForm1::btnDecryptClick(TObject *Sender) 69 | { 70 | Screen->Cursor = crHourGlass; 71 | GenerateLMDKey(Key64, sizeof(Key64), edtPassphrase->Text); 72 | GenerateLMDKey(Key128, sizeof(Key128), edtPassphrase->Text); 73 | GenerateLMDKey(Key192, sizeof(Key192), edtPassphrase->Text); 74 | GenerateLMDKey(Key256, sizeof(Key256), edtPassphrase->Text); 75 | CipherText = mmoCipherText->Text; 76 | try { 77 | switch ((TEncryption) cbxCipher->ItemIndex) { 78 | case eBf : PlainText = BFEncryptStringEx(CipherText, Key128, false); 79 | break; 80 | case eBfCbc : PlainText = BFEncryptStringCBCEx(CipherText, Key128, false); 81 | break; 82 | case eDes : PlainText = DESEncryptStringEx(CipherText, Key64, false); 83 | break; 84 | case eDesCbc : PlainText = DESEncryptStringCBCEx(CipherText, Key64, false); 85 | break; 86 | case e3Des : PlainText = TripleDESEncryptStringEx(CipherText, Key128, false); 87 | break; 88 | case e3DesCbc : PlainText = TripleDESEncryptStringCBCEx(CipherText, Key128, false); 89 | break; 90 | case eRdl : PlainText = RDLEncryptStringEx(CipherText, Key128, 16, false); 91 | break; 92 | case eRdlCbc : PlainText = RDLEncryptStringCBCEx(CipherText, Key128, 16, false); 93 | break; 94 | } 95 | mmoPlainText2->Text = PlainText; 96 | } 97 | catch (...) { 98 | } // swallow any errors 99 | Screen->Cursor = crDefault; 100 | } 101 | //--------------------------------------------------------------------------- 102 | --------------------------------------------------------------------------------