turbopack / lockbox3 Goto Github PK
View Code? Open in Web Editor NEWLockBox3 is a Delphi and C++Builder library for cryptography.
License: Other
LockBox3 is a Delphi and C++Builder library for cryptography.
License: Other
Hello. I am trying to use LockBox 3.7, which I installed via GetIt on RAD Studio 10.4 with one of my C++ Builder projects.
When building I get "[bcc32 Error] uTPLb_CryptographicLibrary.hpp(174): Simple type name expected"
With the line being
__property TOnGenerateKeyFunc OnCustomCipherGenerateKey = {read=FOnGenerateKeyFunc, write=FOnGenerateKeyFunc};
Demos of how to use Lockbox 3 programmatically are needed.
TurboPack LockBox3 v3.5.0 (Delphi 10 Seattle GetIt package).
The following error is raised by FastMM4 in full debug mode when doing a Base64 decryption:
'FastMM has detected an error during a ReallocMem operation. The block footer has been corrupted...'
The bug appears to be an 'off-by-one' indexing problem in the TBase64Conv.Decrypt method. The local variable 'base64_Fragment' was changed from an ANSIString to a TBytes type at some stage and the in-buffer read pointer index was not adjusted.
Suggested fix:
Line 250 in 'uTPLb_Base64.pas' should be:
FInBuffer.Read( base64_Fragment[0], FromBase64_BufferSize);
Hi there,
I recently switched my projects form D10 to D11. On Android everything is working fine so far. On iOS I'm getting a Integer Overflow using sha1.pas unit while using a dycrpt function. Hopefully you are able to fix this bug soon.
Hello.
I made a comment on another closed topic #4 at the following link: #4 (comment)
The code I used is as follows:
function Cript(const psKey, psText: String; const pbEncrypt: Boolean): String;
const
sKEY = '{0BC16F6A-A80E-4849-88C8-C6BBD57F7A19}'
begin
Codec.StreamCipherId := BlockCipher_ProgId; // 'native.StreamToBlock'
Codec.BlockCipherId := 'native.AES-256';
Codec.ChainModeId := CBC_ProgId; // 'native.CBC'
if Trim(psKey) = EmptyStr then
Codec.Password := sKEY
else
Codec.Password := psKey;
if pbEncrypt then
Result := Codec.EncryptString(psTexto, Result, TEncoding.Default)
else
Result := Codec.DecryptString(Result, psText, TEncoding.Default);
end;
DFM:
object CryptographicLibrary: TCryptographicLibrary
Left = 45
Top = 15
end
object Codec: TCodec
AsymetricKeySizeInBits = 1024
AdvancedOptions2 = []
CryptoLibrary = CryptographicLibrary
Left = 45
Top = 72
StreamCipherId = 'native.StreamToBlock'
BlockCipherId = 'native.AES-256'
ChainId = 'native.CBC'
end
Can anyone help?
sense no response i dont need an answer for this i moved on .
Hi
is there any sample files on how to use the MD5?
I installed it via Getit and the only thing i can see on component palette is Lockbox VCL and i do not see any FMX.
When i was using Delphi 6, the MD5 component will appear on the component palette.
Please help as i would not know where to start.
Hello, is there a possibility to install your Components to the C++ Builder Community Edition ?
I would try the Encrypt/Decrypt Functionallity in one of my Projects.
I see two Versions in the GetIT Manager (2,4 and 3.7) so what do i have to install ?
Version 2.4
Installation installing without THash,TCryptographicLibraray etc - just the Encrypt/Decprypt Method Components.
Version 3.7
Installation installing just THash,TCryptographicLibraray (4 Components) and no Encrypt/Decrypt Method Components - and there is a Error-Message at the Beginning of the Installation (Script-Error).
There is a Error-Message if i try to place a Component on a Form (Not possible in this Module . . .)
cheers
Elmar Baumann
Hello
I found issue with TLbRijndael, the passphrase has no effect, but it works with TLbBlowfish, i would add the following sample
`procedure TForm1.Button1Click(Sender: TObject);
var
ALbRijndael: TLbRijndael;
begin
ALbRijndael := TLbRijndael.Create(nil);
try
ALbRijndael.GenerateKey('aaa');
ALbRijndael.Encoding := TEncoding.UTF8;
Memo2.Text := ALbRijndael.EncryptString(Memo1.Text);
finally
ALbRijndael.Free;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
ALbRijndael: TLbRijndael;
begin
ALbRijndael := TLbRijndael.Create(nil);
try
ALbRijndael.GenerateKey('bbb');
ALbRijndael.Encoding := TEncoding.UTF8;
Memo3.Text := ALbRijndael.DecryptString(Memo2.Text);
finally
ALbRijndael.Free;
end;
end;`
Previously I was using SeanBDurkin/tplockbox 3.6.3.0. I installed the Delphi 10 Seattle LockBox 3.5.0 package from IDE GetIt and I cannot get my previous crypted files to be decrypted with TCodec.DecryptStream. Are the two versions compatibles ? Here is my components configuration :
object Codec1: TCodec
AsymetricKeySizeInBits = 1024
AdvancedOptions2 = []
CryptoLibrary = CryptographicLibrary1
Left = 616
Top = 24
StreamCipherId = 'native.StreamToBlock'
BlockCipherId = 'native.3DES.1'
ChainId = 'native.CBC'
end
object CryptographicLibrary1: TCryptographicLibrary
Left = 624
Top = 88
end
Thanks
Hay Guys (Roman).
Great work on porting lockbox to XE8 - I've been desperately awaiting its return.
I'm struggling to install into C++Builder XE8. I have unpacked the components into $(BCB)\Components\LockBox3. The install notes mention adding in the path to the hpp folder into the C++ System Include paths which I have done ($(BCB)\Components\LockBox3\hpp). it wasn't clear if, for C++Builder you also had to add in the \lockBox3\run path also (I haven't).
I open up the design and run-time CBuilder packages and try to install the design-time package - it fails reporting:
[ilink32 Error] Fatal: Unable to open file 'LOCKBOX3CR.BPI'
I try to compile also and I get the same message. I have searched the lockbox3 folders and there is no sign of the .bpi file although it is listed in the Requires branch in the IDE.
Also, out of interest, do I need to add the path to the \hpp to all of the profiles (Win32, 64, iOS, Android etc in order to use lockbox on all these platforms.
Many thanks
Mike
Hi.
Can you add gcm mode?
thank you
Use Compute_RSA_Fundamentals_2Factors or Use GenerateAsymetricKeyPair To Create key can Encrypt can not Decrypt
`
procedure StoreRSAKeyPairPartsToStream(const Parts: RSAKeyStorePartSet; AKey: TRSAKeyPair; Store: TStream);
var
iVersion: integer;
pBuffer: TBytes;
begin
if AKey = nil then exit;
if Store = nil then exit;
pBuffer := TEncoding.UTF8.GetBytes(RSAKeySig);
Store.WriteBuffer(pBuffer, Length(pBuffer));
iVersion := RSAKeyStoreVersion;
Store.WriteBuffer( iVersion, SizeOf( iVersion));
Store.WriteBuffer( Parts, SizeOf( Parts));
if (PartN in Parts) and (AKey.F_RSA_n <> nil) then
StoreHugeCardinal_Primitive(AKey.F_RSA_n.Value, Store);
if (PartE in Parts) and (AKey.F_RSA_e <> nil) then
StoreHugeCardinal_Primitive(AKey.F_RSA_e.Value, Store);
if (PartD in Parts) and (AKey.F_RSA_d <> nil) then
StoreHugeCardinal_Primitive(AKey.F_RSA_d.Value, Store);
if (PartCRT in Parts) and
(AKey.F_RSA_p <> nil) and (AKey.F_RSA_q <> nil) and (AKey.F_RSA_dp <> nil)
and (AKey.F_RSA_dq <> nil) and (AKey.F_RSA_qinv <> nil) then
begin
StoreHugeCardinal_Primitive(AKey.F_RSA_p.Value, Store);
StoreHugeCardinal_Primitive(AKey.F_RSA_q.Value, Store);
StoreHugeCardinal_Primitive(AKey.F_RSA_dp.Value, Store);
StoreHugeCardinal_Primitive(AKey.F_RSA_dq.Value, Store);
StoreHugeCardinal_Primitive(AKey.F_RSA_qinv.Value, Store)
end;
end;
test code
var
n, e, d, Totient: THugeCardinal;
Count1: Integer;
p, q, dp, dq, qinv: THugeCardinal;
Lib: TCryptographicLibrary;
Codec: TCodec;
AKey: TRSAKeyPair;
s, y: string;
begin
Lib := TCryptographicLibrary.Create( nil);
Codec := TCodec.Create( nil);
AKey := TRSAKeyPair.CreateEmpty;
Totient := nil; n := nil; e := nil; d := nil; p := nil; q := nil; dp := nil; dq := nil; qinv := nil;
Count1 := 0;
Compute_RSA_Fundamentals_2Factors(KeyBitLength, StandardExponent, n, e, d, Totient,
p, q, dp, dq, qinv,
OnProgress, nil,
20,
FPool, Count1, FWasAborted);
AStream.Clear;
AKey.F_RSA_n := NewWrap(n);
AKey.F_RSA_e := NewWrap(e);
AKey.F_RSA_d := NewWrap(d);
StoreRSAKeyPairPartsToStream([PartN, PartE, PartD], AKey, AStream);
AStream.Position := 0;
Codec.InitFromStream(AStream);
Codec.EncryptAnsiString( 'test', y);
Codec.Reset;
Codec.DecryptAnsiString( s, y);
end;
when run on .Decrypt will raise a av error
There is no license specified please specify a license
I have a regular problem with this, and I have no idea how to fix it.
Windows 8.1
Delphi XE7
I cannot find the actual version of the LockBox3, but I downloaded it only a few weeks ago.
Codec1.EncryptStream: TNoncibleEncryptor.End_Encrypt - Internal marshalling error. (....\LockBox3\run\cryptography\uTPLb_StreamToBlock.pas, line 883)
Stream.Size=382 bytes
The code line is:
Assert( Fis2ndBufferFull, AS_BlockToStream_EndEncrypt_InternalMarshalling);
The actual stream has a combination of text and binaries (integers, etc) in it.
code:
INIT:
Codec1 := TCodec.Create(nil);
CryptographicLibrary1 := TCryptographicLibrary.Create(nil);
Codec1.CryptoLibrary := CryptographicLibrary1;
Codec1.StreamCipherId := uTPLb_Constants.BlockCipher_ProgId;
Codec1.BlockCipherId := 'native.AES-256';
Codec1.ChainModeId := uTPLb_Constants.CBC_ProgId;
Codec1.Password := ***
Program:
CryptStream := TMemoryStream.Create;
try
Codec1.Reset;
except
on E:Exception do // Unrecoverable "Privileged Instruction" error???
begin
LocalLog('Codec1.Reset: '+E.Message,d_error);
FreeAndNil(Codec1);
DTBInitFinal; // Restart initializing the Codec.
end;
end;
try
Codec1.EncryptStream(DataStreams[0],CryptStream);
except
on E:Exception do // Unrecoverable error. Sometimes "Internal marshalling error."
begin
LocalLog('Codec1.EncryptStream: '+E.Message,d_error);
FreeAndNil(Codec1);
DTBInitFinal; // Restart initializing the Codec.
CryptStream.Free;
DataStreams.Delete(0);
exit;
end;
end;
Dear Mr.!
I hope you are well.
I installed the components on Delphi 11.3 but I can't find the TOpenSSL_Signatory component.
I have used this component on Delphi 2010 and I would like to move my code for the new Delphi version.
I don't know if I did something wrong or this component was descontinued or it's a bug.
Could you help me, please?
Thank you for your attention!
George De Luca
In issue #6 I believe your answer was unclear - after installing LockBox3 and restarting the IDE, should there be any visual components in the palette?
I've followed instructions to add the 'run' source folder and all subfolders to the library search path, opened the package group and have done a build all in the projects, and have installed the packages. The install succeeds, but no components are listed as installed in the success dialog. The packages DO show up and are enabled in the Component > Install Packages... dialog.
This is in Delphi 'Berlin' 10.1.
The installation package isn't working, because the script contains errors:
End is missing, only d; is shown, and 2 other issues.
Unable To Locate LockBox In Component Palette After Installed LockBox3.
Not working on 11.3 , installation error.
Access violation at address 5D6F8333 in module rtl280.bpl
Does not work with IOS and Android on Delphi 11.
Components are simply unavailable when switching platforms.
Hi,
After installing LockBox3 via GetIt into Alexandria, I noted that my unit tests for TP LockBox3 started failing: one integer overflow error and one range checking error.
A comparison of the source code to the version we were using previously (3.6.3) shows that there are missing compiler switches for exactly these errors:
In uTPLb_SHA1.pas, there should be
{$IFOPT Q+}
{$DEFINE OVERFLOWON}
{$Q-}
{$ELSE}
{$UNDEF OVERFLOWON}
{$ENDIF}
procedure TSHA1_Hasher.Update( Source: TMemoryStream);
...
end
{$IFDEF OVERFLOWON}
{$Q+}
{$UNDEF OVERFLOWON}
{$ENDIF}
and in uTPLb_StreamUtils.pas, there should be
{$IFOPT R+}
{$DEFINE RANGEON}
{$R-}
{$ELSE}
{$UNDEF RANGEON}
{$ENDIF}
function Stream_to_Base64( Source: TStream; const Transform: string = ''): string;
...
end
{$IFDEF RANGEON}
{$R+}
{$UNDEF RANGEON}
{$ENDIF}
and
{$IFOPT R+}
{$DEFINE RANGEON}
{$R-}
{$ELSE}
{$UNDEF RANGEON}
{$ENDIF}
procedure CustomBase64_to_stream( const Base64: string; Destin: TStream;
const InverseTransform: TInverseBaseTransform);
...
end
{$IFDEF RANGEON}
{$R+}
{$UNDEF RANGEON}
{$ENDIF}
I hope this helps someone else who stumbles across this problem, and hopefully, these changes can be reincorporated back into the packages installed by GetIt.
There are at least {$APPTYPE GUI} that'll break console app, possibly depending on things in which order units are initialized, maybe.
if that is not absolutely needed there should be removed. Can't figure out why it is there at first place.
Howdy!
I am new to LockBox3 and don't see any documentation or examples (preferably in C++).
Does any such things exist?
Thanks,
Shane
Hi,
I've downloaded the zip file and am trying to install lockbox3 on Delphi XE6.
The installation readme file referres to a source folder that I should add to my Library path, but it does not exist! It is also not on github.
Please advise.
Johan
Is that correct that there are "no" components installed inside XE10 or XE8 IDE? (It tells me that the package is installed(no errors raised) which I can confirm but no components in the component palette nor a Lockbox entry can be found, so I only can use Lockbox non visually.)
I've already followed the installation process more then once but can't get it working no matter what I've tried.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.