Encryptar/Decryptar strings with Delphi

Asked

Viewed 97 times

0

For knowledge purposes, I would like to create my own not very complex function to encrypt and decrypt program strings.

I got this piece of code from the Internet s1[1] := Char((Byte(s1[1]) shl 4) or (Byte(s1[1]) shr 4));. It is used to decrypt the strings, if I understand well what it does is to shift 4 bit to left or right and then convert byte to char. With that advice I tried to do the reverse to encrypt.

I tried to convert each character to ascii/hexa and shift 4 bit to right/left with shr and shl but the result was never as expected.

Aguem could correct or show how the Encrypter of this code would be shown ?

  • I can’t, there’s practically nothing in the question. But I don’t know if I’d call it encryption. Technically it is, but it seems to be too simple.

  • Sorry my lack of attention the real code now...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.