decfpc / delphiencryptioncompendium Goto Github PK
View Code? Open in Web Editor NEWDelphi Encryption Compendium
License: Other
Delphi Encryption Compendium
License: Other
My program work flawlessly, however when I change the cipher algorithm to Twofish I get an Integer overflow... Can't possibly figure out what may cause this issue.
I do guess that you forked from this one:
https://github.com/Winkelsdorf/DelphiEncryptionCompendium
Which got quite some changes over the last few years to make it cross platform compatible, fix bugs, transform the test program into proper DUnit/DUnitX unit tests etc.
Would it make sense to check what you changed from the original to make it better FPC compatible and join forces in the one above? (I'm asking because I'm currently the main contributor to the one above) If you like you can find my e-mail address in the notices.txt over there (the one marked as main one) and contact me via that one.
I try use THash_SHA512 and result is is different than e.g. here:
http://www.convertstring.com/pl/Hash/SHA512
The THashSHA2 class is available from Delphi Seattle, which also has a different hash than the DEC class.
Hi.
I would like to use your library. How would I use it to get a result in an array buffer?
If I send it a string 'QPIGS' I know I need to get this result back
QPIGS$B7$A9 this is the command with 2 byte CRC ad last byte is a end of line chr(13)
If I use this hardcoded value it works. I want to get to the same result using the CRC16 from your library if possible.
command : array[1..8] of Byte = (byte('Q') , byte('P'), byte('I') , byte('G') , byte('S') , $B7 , $A9 , $0D );
The Delphi Encryption Compendium is exactly what I require for storing passwords in a database. However, the issue I am having is with compiling my programs as 64-bit Windows executables.
I have no issues with 32-bit. But when I use your code in a Win64 application, I get compile error("[dcc64 Error] DECCipher.pas(6001): E2016 Array type required")
I am attempting to recreate a library written in long ago with the then current version of DEC. This library using Blowfish cipher to encrypt a string using a hexadecimal key value.
The issue is when I duplicate the functionality using the current library and the previous key value I do not get the same hexadecimal result. Is the current library compatible with the old?
Hail, how can i use DECRandom to get a random number out of 1000 for example?
`uses DECRandom
procedure TForm1.Button1Click(Sender: TObject);
begin
//????????
memo1.lines.add(inttostr(decrandom(1000))); //???
end;
`
Im trying to encrypt/decrypt with AES 256, but I can not get the same result as php, here is the example:
text = {"idServicio":79, "idProducto":209 , "referencia": "40425475190118187271", "montoPago": 9999, "telefono":"1111111111", "horaLocal":"20200401222821"}
Encrypted text = "DB8BRqb2q6BW/HLQYN2pr2n9DTL1Q8kp2lvZi3rogbxjEasiMbgU4q5/vDav+p0O0KWlfMmNekXN+UkbUiB+s/LNf1MF2EgOQEZoivxgp+UJxsuT5vDIMmQXUkuwkyUE+a7hH5FwaDDY8DNwW2kowFXeE69AcOMaWnyZ+YplKNEUOzQzLstBxWnJE+aSr0+vQN3knkIIjbT10yfSTV/OQA==
"
PHP:
class AesCipher
{
const CIPHER = 'AES-256-CBC';
const SECRET_KEY = 'HPo7OLqB4Fkk4E2yGOtwqw8H5fHR9kNx67OR4g4UdlA=';
const SECRET_IV = 'p5ldmBPdd/9pjC0bDC/nSg==';
public static function encrypt($text)
{
$output = false;
$output = openssl_encrypt($text, self::CIPHER, base64_decode(self::SECRET_KEY), OPENSSL_RAW_DATA, base64_decode(self::SECRET_IV));
return base64_encode($output);
}
public static function decrypt($cypherText)
{
$output = false;
$output = openssl_decrypt(base64_decode($cypherText), self::CIPHER, base64_decode(self::SECRET_KEY), OPENSSL_RAW_DATA, base64_decode(self::SECRET_IV));
return $output;
}
}
Delphi:
Lkey:=TBase64Encoding.Base64.DecodeStringToBytes( EditKey.Text);
SKey:='';
for I := Low(Lkey) to High(Lkey) do
SKey:=SKey + char(Lkey[i]);
Cipher.Init(Skey, {RawByteString(SkeyEditKey.Text)}
TFormat_HEX.Decode(RawByteString(EditInitVector.Text)),
StrToInt('0x' + EditFiller.Text));
I guess that the issue is when I convert key from base64, the IV is on hex.
Thanks
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.