-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use dynamic loading and cross-platform support #1
Comments
Not sure |
Looks like Delphi handles all the heavy stuff : http://docwiki.embarcadero.com/RADStudio/Athens//en/Procedures_and_Functions_(Delphi)#Importing_Functions_from_Libraries Maybe it's just a matter of adding ifdefs to change the name of the shared lib depending on the target system. |
Yes of course, just like that, you use ifdefs to change the name of the shared lib depending on the target system. And RTL |
I have worked on a fork that use dynamic loading (it's working but not all LibSodium functions were ported), I have also used the Utils and helpers you made, they were very useful. |
See :
|
Isn't it possible to have simple and easy to use wrappers like those in PHP
?
I mean they have very easy functions that take text and key and nonce input
as string then it will return the encrypted or decrypted text as string
directly from the function.
Is it possible to do that for AEGIS functions ?
Le mer. 19 juin 2024 à 21:49, Pierre Yager ***@***.***> a
écrit :
… crypto_aead_aegis256_encrypt() encrypts the provided cleartext buffer
into ciphertext with authentication and additional data (that's what aead
means) the resulting buffer contains encrypted data, additional data *and*
a hash that authenticates everything.
See :
- https://en.wikipedia.org/wiki/Authenticated_encryption
-
https://libsodium.gitbook.io/doc/secret-key_cryptography/aead/aes-256-gcm
- Here is an example on how to misuse AES "GCM" :
https://frereit.de/aes_gcm/ (TLDR; never reuse the nonce. A nonce is a
*number* used *once*)
@key[0] is a pointer to the very first byte of the key buffer, you may
"convert" it to an hexadecimal string, maybe by using TBuffer.ToHex()
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOEZA46RP73PIO5LQZLHANDZIHVHDAVCNFSM6AAAAABJR3YBSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZZGQ2DAMRYGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Have you had a look at high level wrappers, like https://github.com/zedalaye/Delphi-NaCl/blob/master/lib/Sodium.Aead.pas ? |
Well I tried that wrapper and I also tried to tweak the demo. All what I need is the ability to store the ciphered text and key and nonce as string for a delayed decryption/encryption, instead of jumping between Bytes and Pointers. But I am still stuck with unknown error because the function raise no error. I tweaked the demo procedure in order to get string format of the key and nonce, like this :
And here is the used code for the decryption, it is in a GUI form with TEdit controls to enter the ciphered text and key and nonce copied from the tweaked demo procedure :
|
Is it possible to use dynamic loading for the DLL (
LoadLibrary
,GetProcAddress
andFreeLibrary
) in order to use this wrapper in FMX cross-platforms projects ?The text was updated successfully, but these errors were encountered: