# practical question

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

•  Subject
• Author
• Posted on
Hi,
Out of curiosity. When you have an encryption, say rsa, where
you have to take a message, and raise it to some power modulu something
- how
it is practicaly implemented?  It's surely impractical to treat the
whole message/file as a huge number and then try to raise it to some
power - for example, with crc16/32, I have a table, and I can
iteratively go byte-byte, updatiing the CRC, so how it is done with
encryption ?

Thanks,
Alex

## Re: practical question

:Out of curiosity. When you have an encryption, say rsa, where
:you have to take a message, and raise it to some power modulu something
:- how
:it is practicaly implemented?  It's surely impractical to treat the
:whole message/file as a huge number and then try to raise it to some
:power

It depends on the algorithm and upon the mode of the algorithm.
Most encryption algorithms work with fixed size blocks of
plaintext (padding with 0's if necessary) so as to keep the problem
within bounds.

Many encryption algorithms have two modes, one
in which each block is treated seperately, and one in which
some internal values produced by the algorithm are used to
initialize the algorithm for the next round of encryption
[in the non-chaining version, the variables are instead initialized
with constant values.] Independant blocks is not as secure, but
more useful in (e.g.,) communications devices where a packet might
get lost, or in embedded implimentations that do not have enough
"scratch memory" to be able to hold the values.

:- for example, with crc16/32, I have a table, and I can
:iteratively go byte-byte, updatiing the CRC, so how it is done with
:encryption ?

Oh, it's the same, except the size of the byte is bigger. ;-) ;-)
--
"Mathematics? I speak it like a native."  -- Spike Milligan

## Re: practical question

Public-key encryption algorithms like RSA are usually not used to
encrypt long messages.  Symmetric algorithms like DES and AES are used
for this.  A random key is chosen for this step, and the public-key
mechanism is used to distribute the key.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***