encrypt the text ..... any hint pleas
i want help for this issue if u can help me !!!!
To encrypt the text, we take the word "python" and make it at least the same size as "welcome home" by repeating it as follows: w e l c o m e h o m e p y t h o n p y t h o n Then, we convert each letter into its numerical ASCII value as follows: w e l c o m e h o m e = 119 101 108 099 111 109 101 032 104 111 109 101 p y t h o n p y t h o n = 112 121 116 104 111 110 112 121 116 104 111 110 Next, we add the numbers together. 119 101 108 099 111 109 101 032 104 111 109 101 + 112 121 116 104 111 110 112 121 116 104 111 110 -------------------------------------------------- 231 222 224 203 222 219 213 153 220 215 220 211 And, finally, we convert the numbers back into their corresponding ASCII character: any hint will be v.good as soon as possible if u can replay thnx :) |
Hint for what? Maybe it's me, but I'm having a hard time finding your question.
|
I agree, I cannot see a question here, save maybe the one that the teacher asked when he set this task.
|
can u help me in this :(
am trying to genarate a programm
that will take a text file as input, either encrypt or decipher the text using a keyword cipher (Vigenere cipher), and save the modified text file. The program should ask the user for the keyword to use in the cipher, whether the file needs to be encrypted or deciphered, and the name of both the input file and the output file. To encrypt the text, we take the word "python" and make it at least the same size as "welcome home" by repeating it as follows : w e l c o m e h o m e p y t h o n p y t h o n Then, we convert each letter into its numerical ASCII value as follows: w e l c o m e h o m e = 119 101 108 099 111 109 101 032 104 111 109 101 p y t h o n p y t h o n = 112 121 116 104 111 110 112 121 116 104 111 110 Next, we add the numbers together. 119 101 108 099 111 109 101 032 104 111 109 101 + 112 121 116 104 111 110 112 121 116 104 111 110 -------------------------------------------------- 231 222 224 203 222 219 213 153 220 215 220 211 finally we convert the numbers back into their corresponding ASCII character: 231 222 224 203 222 219 213 153 220 215 220 211 = ç Þ à Ë Þ Û Õ ™ Ü × Ü Ó |
Ehhhh, maybe it's me but welcomehome is size 11 and pythonpython is size 12!?
|
Quote:
Seems the space may be included. OP - That seems like quite a good exercise, but I would ask again, what is your question? At the moment it reads like this - "I have an assignment and would like you to do it for me?" |
Quote:
|
Are you sure that the ASCII values should simply be added?:scratch: The problem is much easier if the addition is done mod 256, and even easier if you use an XOR function to combine the plain text and the key. If the XOR is used, a second XOR of the key will recover the plain text.
|
i made a software which does the encryption
only thing is i didnt add your ascii values .. i made a much simpler version of it ... i used a look up table to convert those numbers into a alphabets... for example if we have a string ... hello world ... the ascii values of the characters in the string including space is 104 101 108 108 111 32 119 111 114 108 100 .. now this is how the string of numbers would appear .. 10410110810811132119111114108100 ..now what i did is .. i made a look up table ( a= 0,b=1.. j=9)...and convert those numbers into characters so now the string would look like this .. baebabbaibbbdjbbbbbebaibaa.. its just a suggestion.. :)
|
Quote:
Quote:
End |
what does the 032 have to do with anything ?? i don't understand
|
Quote:
@bhb: This is a linux forum, not a programming one. Ignoring that, it seems you are basically asking for someone to do your homework for you, as has already been said. Further ignoring *that*, you have not specified a language, so, even if we want to, we can't help you as it stands. PTrenholme raised a valid point. It isn't just easier to use XOR or modular arithmetics, you simply *can't* use addition, or your bytes will overflow - unless, of course, you use 7bit ascii for both the key and the plaintext and 8bit for ciphertext, or something like that. There are numerous resources around the web dealing with this kind of simple encryption. You may want to google for 'XOR cipher'. Basic file I/O isn't too difficult to find either, in any language of your choice. |
All times are GMT -5. The time now is 08:41 AM. |