Coder Social home page Coder Social logo

delphiencryptioncompendium's People

Contributors

decfpc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

delphiencryptioncompendium's Issues

Compatability with older library version

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?

Cannot compile as Windows 65-bit

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")

image

How to use CRC16 to get a 2 byte result.

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 );

Twofish issue

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.

Would it make sense to merge your canges back into the repo you forked from?

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.

Need some Help Using AES

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

How can i use DECRandom.pas ?

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;
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.