Hi i'm writing a program in java to test a variant of the elgamal encryption, however my problem is not the encryption/decryption
chain itself, but how to perform the operations on the input given: a text file. I have a text file with some words in it (for example the content can be: "Hello world, this is a test"
) and i need to perform numeric operations on them like this:
ciphertext= (message * y) mod p
where y
and p
are two biginteger
. I tried this conversion chain: (reading one string at time):
String->Hexadecimal->Decimal
Then perform the encrypt operation, and then the inverse:
Decimal->Hexadecimal->String
But this doesn't work all the time (i'm currently investigate on this issue). fixed.
My question is, there is a better way to do this? I was reading about the byte array
's but i'm not sure how to use them.
[i can post an example of the encryption/decryption chain if needed]