Skip to content

Commit

Permalink
Release v3.6.3.0
Browse files Browse the repository at this point in the history
1. updated read-me for XE7
2. modernise string and tbytes treatment in demo
3. harden Blowfish self-test for D2009 compiler
  • Loading branch information
unknown authored and unknown committed Aug 5, 2015
1 parent f5cb6dc commit f97d956
Show file tree
Hide file tree
Showing 9 changed files with 396 additions and 104 deletions.
71 changes: 20 additions & 51 deletions How_to_build_LockBox3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,41 @@ To build TurboPower LockBox 3, follow these steps.
as you prefer for your development environment. (See notes about
Environment Variables below).

2. Compile the main run-time package.
2. Compile the main run-time package (TP_LockBox3.dproj) for each platform. Use the DEBUG config if you want to be able to step through the lockbox code at run-time, otherwise use the RELEASE config.
By default the dcu's will be placed in '..\..\work-products\ephemeral\dcu\XE7\$(Platform)' relative to the project head, but you can override this.
The default the dcp's will be placed as per your IDE settings (Tools | Options... | etc.), but you can override this.

3. Compile the main design-time package.
3. Take a note of the paths in step 2. Check that the output dcu's and dcp is where you expect them to be. If not already present, add the dcu path and the dcp path (but not the source path) to the
library path for each platform. You can also add the source path ('run' directory) to the IDE browsing path).

4. Compile the main design-time package (dclTP_LockBox3.dproj). Use Win32 platform, RELEASE config.
If upgrading from a previous version, it is safer to uninstall the previous lockbox design-time package first.

4. Install the main design-time package.
5. Install the main design-time package.

5. Use and enjoy !
6. Use and enjoy !


Package, Application and Group heads
====================================
Here is listed the package heads and thier purposes.
Here is listed the package heads and their purposes.

\packages\d2010\TP_LockBox3_d2010.groupproj
The project group for Delphi 2010 without SmartInspect
\packages\XE7\TP_LockBox3_XE7.groupproj
The project group for Delphi XE7

\packages\d2010\TP_LockBox3.dpk
The main run-time package for Delphi 2010 without SmartInspect
\packages\XE7\dclTP_LockBox3.dpk
The main design-time package for Delphi XE6

\packages\d2010\dclTP_LockBox3.dpk
The main design-time package for Delphi 2010 without SmartInspect
\packages\XE7\Lockbox3_Demo.dpr
The demonstration program for Delphi XE7

\packages\d2010\Lockbox3_Demo.dpr
The demonstration program for Delphi 2010 without SmartInspect

\packages\d2010\LockBox_DUnit_Tests.dpr
\packages\XE7\LockBox_DUnit_Tests.dpr
The D-Unit test suite running under Delphi 2010 without SmartInpect support.

\packages\d2010\MakeSampleKey.dpr
\packages\XE7\MakeSampleKey.dpr
A demonstration program for Delphi 2010 without SmartInspect, to create
an RSA key.

\packages\d2010\Precompute.dpr
\packages\XE7\Precompute.dpr
Program which show how the AES look-up tables were precomputed.

And similary for Delphi 2010 WITH SmartInspect support ...
\packages\d2010 with SmartInspect\TP_LockBox3_d2010.groupproj
\packages\d2010 with SmartInspect\TP_LockBox3.dpk
\packages\d2010 with SmartInspect\dclTP_LockBox3.dpk
\packages\d2010 with SmartInspect\LockBox_DUnit_Tests.dpr
\packages\d2010 with SmartInspect\MakeSampleKey.dpr
\packages\d2010 with SmartInspect\Precompute.dpr


And similary for Delphi 2007 ...
\packages\d2007\TP_LockBox3_d2007.groupproj
\packages\d2007\TP_LockBox3.dpk
\packages\d2007\dclTP_LockBox3.dpk
\packages\d2007\Precompute.dpr


Environment Variables
======================
In used the following environment variables in the project options.
Free free to clear the directory settings in the Project Options and
not use these:

$(DCU) ---- directory for compiled units (.dcu files).
$(DCP) ---- directory for comiled packages (.dcp files).
$(BPL) ---- directory for packages (.bpl files).
$(EXE) ---- directory for applications (.exe files).

Conditional Defines
===================
I used the following custom conditional defines.
{$SI} ==== Means that SmartInspect is supported. Requires SmartInspect
to be installed.


35 changes: 4 additions & 31 deletions demo/D2010+/umfmLockbox3_Demo.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@ object mfmLockbox3_Demo: TmfmLockbox3_Demo
Top = 0
Width = 520
Height = 569
ActivePage = tbSymetric
ActivePage = tbSignature
Align = alClient
MultiLine = True
TabOrder = 1
object tbSymetric: TTabSheet
Caption = '1. Symetric basics'
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = (
512
523)
Expand Down Expand Up @@ -235,10 +231,6 @@ object mfmLockbox3_Demo: TmfmLockbox3_Demo
object tbSeeding: TTabSheet
Caption = '2. Seeding'
ImageIndex = 1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object bvlScriblePad: TBevel
Left = 4
Top = 342
Expand Down Expand Up @@ -361,10 +353,6 @@ object mfmLockbox3_Demo: TmfmLockbox3_Demo
object tbSymetricExtent: TTabSheet
Caption = '3. Symetric extensions'
ImageIndex = 2
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = (
512
523)
Expand Down Expand Up @@ -573,10 +561,6 @@ object mfmLockbox3_Demo: TmfmLockbox3_Demo
object tbKeyGen: TTabSheet
Caption = '4. RSA - Key generation and storage'
ImageIndex = 3
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = (
512
523)
Expand Down Expand Up @@ -669,10 +653,6 @@ object mfmLockbox3_Demo: TmfmLockbox3_Demo
object tbSignature: TTabSheet
Caption = '5. RSA - Signature && Verification'
ImageIndex = 4
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = (
512
523)
Expand Down Expand Up @@ -879,10 +859,6 @@ object mfmLockbox3_Demo: TmfmLockbox3_Demo
object tbHashes: TTabSheet
Caption = '6. Hashes'
ImageIndex = 5
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = (
512
523)
Expand Down Expand Up @@ -967,10 +943,6 @@ object mfmLockbox3_Demo: TmfmLockbox3_Demo
object tbOpenSSL: TTabSheet
Caption = '7. RSA via OpenSSL'
ImageIndex = 6
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = (
512
523)
Expand Down Expand Up @@ -1465,7 +1437,7 @@ object mfmLockbox3_Demo: TmfmLockbox3_Demo
Left = 576
Top = 88
Bitmap = {
494C010103000A00040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
494C010103000A000C0010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000001000000001002000000000000010
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
Expand Down Expand Up @@ -1601,7 +1573,8 @@ object mfmLockbox3_Demo: TmfmLockbox3_Demo
001FE00F001F0000000FE00F000F00000007E007000700000003E00700030000
0001E007000100000000800300000000001F0000001F0000001F0000001F0000
001F0000001F00008FF100018FF10000FFF98001FFF90000FF75C003FF750000
FF8FC007FF8F0000FFFFFF9FFFFF0000}
FF8FC007FF8F0000FFFFFF9FFFFF000000000000000000000000000000000000
000000000000}
end
object CryptographicLibrary1: TCryptographicLibrary
Left = 592
Expand Down
6 changes: 3 additions & 3 deletions demo/D2010+/umfmLockbox3_Demo.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1391,17 +1391,17 @@ procedure TmfmLockbox3_Demo.actVerifyUpdate( Sender: TObject );

procedure TmfmLockbox3_Demo.btnComputeHashClick( Sender: TObject );
var
a: ansistring;
a: string;
s: string;
HashWord: uint32;
Xfer: Integer;
begin
if rgHashSource.ItemIndex <= 0 then
begin
a := edtHashSource.Text;
StringHash.HashAnsiString( a );
StringHash.HashString( a, TEncoding.UTF8);
LogFmt
( 'SHA-384 of ansistring ''%s'' rendered in little-endien base64 is:',
( 'SHA-384 of utf-8 string ''%s'' rendered in little-endien base64 is:',
[a] )
end
else
Expand Down
14 changes: 7 additions & 7 deletions demo/uDemoBlockModeCipher.pas
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
unit uDemoBlockModeCipher;
interface
uses Classes, TPLB3.StreamCipher, TPLB3.BlockCipher,
uses Classes, TPLB3.StreamCipher, TPLB3.BlockCipher, SysUtils,
TPLB3.SimpleBlockCipher, TPLB3.CryptographicLibrary;

const
Expand All @@ -12,9 +12,9 @@ interface
TDemoBlockModeCipher = class( TSimpleBlockCipher)
protected
function Encrypt(
const Buffer: RawByteString;
const Buffer: TBytes;
Key: TSimpleBlockCipherKey;
doEncrypt: boolean): RawByteString; override;
doEncrypt: boolean): TBytes; override;

public
class procedure SelfRegister( Lib: TCryptographicLibrary);
Expand All @@ -35,14 +35,14 @@ implementation
{ TDemoBlockModeCipher }

function TDemoBlockModeCipher.Encrypt(
const Buffer: RawByteString;
Key: TSimpleBlockCipherKey; doEncrypt: boolean): RawByteString;
const Buffer: TBytes;
Key: TSimpleBlockCipherKey; doEncrypt: boolean): TBytes;
var
j: integer;
begin
SetLength( result, DemoBlockSize);
for j := 1 to DemoBlockSize do
result[ j] := ansichar( byte( Buffer[ j]) xor byte( Key.FKeyData[ j]))
for j := 0 to DemoBlockSize - 1 do
result[ j] := byte( Buffer[ j]) xor byte( Key.FKeyData[ j])
end;


Expand Down
4 changes: 2 additions & 2 deletions packages/XE7/Lockbox3_Demo.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ program Lockbox3_Demo;

uses
Forms,
uDemoBlockModeCipher in '..\..\demo\uDemoBlockModeCipher.pas',
umfmLockbox3_Demo in '..\..\demo\D2010+\umfmLockbox3_Demo.pas' {mfmLockbox3_Demo};
umfmLockbox3_Demo in '..\..\demo\D2010+\umfmLockbox3_Demo.pas' {mfmLockbox3_Demo},
uDemoBlockModeCipher in '..\..\demo\uDemoBlockModeCipher.pas';

{$R *.res}

Expand Down
Loading

0 comments on commit f97d956

Please sign in to comment.