G
G
Genile2020-03-12 22:25:31
C++ / C#
Genile, 2020-03-12 22:25:31

How are text and key entered in RC6?

Hello, I have an rc5 implementation, in c++ (dragged from the git). I took it to understand what is happening in this block cipher.
I looked at different implementations of both rc5 and rc6 on github. I still do not understand how the text should be entered at all?
I know that the key, for example, needs to be entered by the user, but in the form of text? In the form of hex? Or will this text also need to be translated into hex in the program?
It's just that C++ does not have an add-on in its libraries to immediately translate text into the 16th form.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GrayHorse, 2020-03-13
@Genile

Cryptographic algorithms work with binary data.

How should text be entered?

As you wish. As a string, hex string, base64 encoded binary string, 32-bit word array, etc.
This is all then converted to binary format. In the case of a string, do not forget to take into account the encoding with which the text is encoded.

M
mayton2019, 2020-03-13
@mayton2019

A scheme in which the user enters SOMETHING from the keyboard and this something is considered as an encryption key is a very weak scheme and does not withstand attacks. The user is lazy and stupid. And he will always try to enter passwords and keys in 1-2 characters. There's nothing to be done about it. Therefore, if the author is interested in making the key field more complex, you must first use SALT in conjunction with a password. And use a hashing function like SHA1 to get a more or less complex key. In some cases (session keys) it is possible to get entropy from the outside world (hours in microseconds and the current position of the mouse on the screen).
That is, the very presence of the RC5 algorithm in the circuit does not guarantee that your system is reliable. It is necessary that its use be pure and devoid of the human factor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question