toufik 2 Posted December 29, 2021 what 's the best way to encrypt a string .?, and to it password for example Share this post Link to post
David Heffernan 2353 Posted December 29, 2021 It depends on what your usage is 1 Share this post Link to post
toufik 2 Posted December 29, 2021 2 minutes ago, David Heffernan said: It depends on what your usage is i want to encrypt serial number Share this post Link to post
David Heffernan 2353 Posted December 29, 2021 It doesn't much matter what the thing is that you encrypt. What matters is who encrypts it, and who has knowledge of the key or keys used to encrypt and decrypt. That's what I mean by usage. As for how you do it, convert the text to binary using a well defined encoding, e.g. UTF8, and encrypt that. Encryption algorithms work with binary data not text. 1 Share this post Link to post
toufik 2 Posted December 29, 2021 3 minutes ago, David Heffernan said: It doesn't much matter what the thing is that you encrypt. What matters is who encrypts it, and who has knowledge of the key or keys used to encrypt and decrypt. That's what I mean by usage. As for how you do it, convert the text to binary using a well defined encoding, e.g. UTF8, and encrypt that. Encryption algorithms work with binary data not text. thanks for replay i will try to get into it thank s again Share this post Link to post
FPiette 385 Posted December 29, 2021 There are a huge number of encryption methods. The best depends on the context you say nothing about. As a start, see this article which is really a very basic encryption method. For a more advanced solution, look for example at this source code on github. 1 Share this post Link to post
David Heffernan 2353 Posted December 29, 2021 4 minutes ago, FPiette said: As a start, see this article which is really a very basic encryption method. Nothing there is useful. Hard to get past the basic sin of treating a string as if it were a byte array. 1 Share this post Link to post
corneliusdavid 220 Posted December 29, 2021 12 hours ago, toufik said: what 's the best way to encrypt a string .?, and to it password for example You mention passwords (and then serial numbers). Instead of encrypting, do you just want to hash it and store the hash, which can't be decrypted? This is often done with passwords (or a serial number that is entered for verification) where you don't ever need to decrypt the stored value, just generate a hash each time it's entered and compare the entered hash to the stored hash. 1 Share this post Link to post
Anders Melander 1815 Posted December 29, 2021 11 hours ago, David Heffernan said: Nothing there is useful. Hard to get past the basic sin of treating a string as if it were a byte array. Not that what you say aren't true, but look at the screenshots. It's Delphi 7 so strings are basically byte arrays. Share this post Link to post
David Heffernan 2353 Posted December 29, 2021 19 minutes ago, Anders Melander said: Not that what you say aren't true, but look at the screenshots. It's Delphi 7 so strings are basically byte arrays. Fair enough. Let's just switch to PHP then and be done with it. Bruh. 1 1 Share this post Link to post
toufik 2 Posted December 30, 2021 (edited) thank you all for help @FPiette you helped a lot thanks again ..... Edited December 30, 2021 by toufik Share this post Link to post
Kim Madsen 4 Posted December 31, 2021 Here is a blog post about exactly that. https://components4developers.blog/2017/09/01/encryption-of-a-string/ 1 Share this post Link to post
toufik 2 Posted January 1, 2022 16 hours ago, Kim Madsen said: Here is a blog post about exactly that. https://components4developers.blog/2017/09/01/encryption-of-a-string/ great components ,,not free tho ^^ thanks for reply Share this post Link to post
Kim Madsen 4 Posted January 1, 2022 15 hours ago, toufik said: great components ,,not free tho ^^ thanks for reply kbmMW Community Edition is free and contains what you need. 1 Share this post Link to post
Foersom 5 Posted January 1, 2022 (edited) 15 hours ago, toufik said: great components ,,not free tho ^^ thanks for reply Delphi Encryption Compendium, version 6.x, can do everything and is free. https://github.com/MHumm/DelphiEncryptionCompendium Edited January 1, 2022 by Foersom 1 Share this post Link to post
toufik 2 Posted January 2, 2022 11 hours ago, Foersom said: Delphi Encryption Compendium, version 6.x, can do everything and is free. https://github.com/MHumm/DelphiEncryptionCompendium thanks i will give it a try Share this post Link to post