A
A
Alexander Voloshyn2014-04-11 00:01:49
C++ / C#
Alexander Voloshyn, 2014-04-11 00:01:49

How to encrypt string with rsa algorithm?

Hello, I understand the rsa algorithm itself, but I don't understand its software implementation.
After all, when I encrypt a variable of type char, then my value should be about 2 thousand, but char lies within the boundaries of [0; 255], which is why when I assign about 2 thousand to a variable, it is taken modulo 256 and it becomes impossible to decrypt the ciphertext .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Deerenaros, 2014-05-06
@VoloshinAlex777

Well, actually, it would not be bad for you to get acquainted with long arithmetic . Well, you drive data into it, because data is just bits, a vector of ones and zeros. And char is a vector of bits of length 8. There is no limit in long arithmetic and everything is limited by the modulus. Something like this.

T
Trrrrr, 2014-04-11
@Trrrrr

translate the character into unisged int and that's it. Or pack 4 characters as one int.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question