How do you reverse mod?

Reply

Join Date: Dec 2007
Posts: 10
Reputation: ivabigun is an unknown quantity at this point 
Solved Threads: 0
ivabigun ivabigun is offline Offline
Newbie Poster

How do you reverse mod?

 
0
  #1
Dec 7th, 2007
Hi,

I am wanting to reverse mod 128 or 255 on ASCII values, does anyone know how to do this?

Thanks
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,346
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 498
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: How do you reverse mod?

 
0
  #2
Dec 7th, 2007
You cannot really reverse a mod operation, as only the remainder of the division operation is retained.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 10
Reputation: ivabigun is an unknown quantity at this point 
Solved Threads: 0
ivabigun ivabigun is offline Offline
Newbie Poster

Re: How do you reverse mod?

 
0
  #3
Dec 7th, 2007
So if i wanted to encrypt plaintext into full ASCII values and then decrypt back to plaintext how would i do this?

I was hoping to mod the plaintext by 255 and then reverse mod back again, but if this cant be done im pretty stumped
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,346
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 498
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: How do you reverse mod?

 
0
  #4
Dec 7th, 2007
Well, if you are reducing a specific range (i.e. 256-511) by modding by 255, then yes you can get back to the number by adding the starting range value to the mod value. However, if your range exceeds 255 then you would lose the ability to reconstruct the value.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 10
Reputation: ivabigun is an unknown quantity at this point 
Solved Threads: 0
ivabigun ivabigun is offline Offline
Newbie Poster

Re: How do you reverse mod?

 
0
  #5
Dec 7th, 2007
the length is dependant on the key and message (in a text file) length. Can anyone shed some light on how to encrypt these int arrays to ASCII values and then decrypt back to standard?

Thanks for your time
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC