Encryption and decryption

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Encryption and decryption

Mesaj gönderen mia »

i have record in mysql database i want to get the database record and encrypt its visibility to a viewer for example

i have record like this

Id : A45KL82 i want to encrypt it for exampl like this

{A450121E-KL02-8384-E853-256E62297091}
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
G.Arkas
Üye
Mesajlar: 829
Kayıt: 01 Eki 2007 07:16
Konum: İstanbul
İletişim:

Re: Encryption and decryption

Mesaj gönderen G.Arkas »

Is this a GUID?
Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: Encryption and decryption

Mesaj gönderen mia »

i want to encode that record exactly same as GUID
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
vkamadan
Kıdemli Üye
Mesajlar: 1935
Kayıt: 17 Mar 2004 03:52
Konum: Adapazarı
İletişim:

Re: Encryption and decryption

Mesaj gönderen vkamadan »

Hi ,
If you want to make "non-reversible" encryption you can use MD5() , Password() or sha() MySQL Functions , for example ;

Kod: Tümünü seç

SELECT MD5(my_secretdata_field) FROM mytable 
if not ,
you can use DECODE() and ENCODE() MySQL Functions for "reversible" encryption. https://dev.mysql.com/doc/refman/5.5/en ... ion_encode
Volkan KAMADAN
www.polisoft.com.tr
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4740
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: Encryption and decryption

Mesaj gönderen mrmarman »

There are two major thing in your quest.
(1) Encrypt / Decrypt operation
(2) The encrypted text format must be look like a GUID type

- In my opinion, you need to take all of them to the Delphi side...
- (1) There are 32 characters exists in GUID type.
- (2) All characters must be between 0..9 and A..F (Hex charset dynamic)
- (3) Your encrypted (after encrypt process) text must be under or equal to 32 characters long.
- So the most important thing:
(a) How long is your source text will be encrypted.
(b) The character set of source. ( you can use longer if exists only numbers. If also characters exists in source text then it must shorter length )

GUID character limit is the only limiting factor in your quest. :idea:

If you only place the text into GUID separeted location, then user can find the solution easily. Two or more records repetation will be reveal your separation technic.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: Encryption and decryption

Mesaj gönderen mia »

can i better insert to database unique unreapeated GUIDs ?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: Encryption and decryption

Mesaj gönderen mia »

i tried something like that to generate unrepeated guids do i have a risk of dublicated record ? here is the code

Kod: Tümünü seç

MyGUID: TGUID;
MyWideChar: array[0..100] of WideChar;
begin
CoCreateGUID(MyGUID);
StringFromGUID2(MyGUID, MyWideChar, 39);
showmessage(WideCharToString(MyWideChar));
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
muratcelik64
Üye
Mesajlar: 17
Kayıt: 16 Tem 2014 05:07

Re: Encryption and decryption

Mesaj gönderen muratcelik64 »

Cevapla