private void decrypt_Click(object sender, EventArgs e)
{
v = Convert.ToDouble (txtencrypt.Text);
t = Math.Pow(v, d);
msg = Convert.ToInt16(Math.Pow(v,d) % Convert.ToDouble(n));
txtdecrypt.Text = Convert.ToString(msg);
}
This is the code im doing for decryption in rsa algorithm but i got a problem in power operation.
For a small power value,the power operation performed well but when im using highest value as a power i got exponential value as a output.
csss 0 Newbie Poster
Mike Askew 131 Veteran Poster Featured Poster
mshauny 25 Junior Poster in Training
tinstaafl 1,176 Posting Maven
csss 0 Newbie Poster
Mike Askew 131 Veteran Poster Featured Poster
tinstaafl 1,176 Posting Maven
csss 0 Newbie Poster
csss 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
tinstaafl 1,176 Posting Maven
csss 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
TnTinMN 418 Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.