[botan-devel] botan-devel Digest, Vol 87, Issue 8

Jack Lloyd lloyd at randombit.net
Fri May 4 10:04:11 EDT 2012

On Fri, Apr 27, 2012 at 01:56:41PM +0000, Sharada Acharya wrote:

> By this what I understood is, for example if the domain of input is
> {a,b,c,d,e,f,g,h,i,j}. For each of these 10 characters I assign a
> number/weight, say 1,2.. upto 10. Now, plaintext = abcde; after
> mapping every character to the corresponding number it becomes
> 12345. I send this number as an argument to fe1_encrypt(); reverse
> way at the time of decrypt. Is my understanding correct ? After
> performing mathematical operations this number, whatever number
> comes out as a ciphertext, will that map to actual weights assigned
> to these characters ?

The intention is that you order the entire set of possible inputs
(this assumes the input space is bounded). For instance, say your
inputs were strings of lowercase letters a-z, up to 10 characters
long. In this case, you can order the inputs from 0 to 26**10-1 using
whatever scheme is convenient, for instance

Then you would encrypt using n = 26**10, converting into a ciphertext
in the range [0, 26**10), and then convert back to the input set, so
your ciphertexts are also now [a-z] strings of length up to 10.


More information about the botan-devel mailing list