![]() |
| ||
| cipher text idea ? this is my code which copies 1st string into 2nd String. AREA StrCopy1, CODE******* Now i want to modify the above code so that it encrypts the dststr using Caesar cipher method and which of course will be printed out on the screen aswell.Thanks for ur reply and i hope it makes the point clear if not feel free to ask me. Br. |
| ||
| Re: cipher text idea ? Quote:
Couple of ways to go about this but I only have time to explain two One is the simpliest you have two strings ABCDEFGHI WLPQSRNXZ You take each char from the source string and find it's equiv in the top string and use that index to find it's equiv in the encryption key there at the bottom. An faster way would be to setup your encryption key as the previous one for the first 9 characters... WLPQSRNXZ Now I find a character in my source string the first character happens to be an 'A' I check a mask to see if it's upper case or lower case and then depending on that outcome I subtract 'A' from it for upper case characters and 'a' from it for lower case characters. What's this give me? An offset sir 'A' - 'A' is 0 and a 0 offset into our above string is 'W' 'B' - 'A' is 1 so a 1 offset. |
| ||
| Re: cipher text idea ? thankx for ur reply sir ! whatever i've got so far is in the code if u can pls have a look and correct me: AREA text, CODE |
| All times are GMT -4. The time now is 6:25 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC