python encryption
<p>i have done the fallowing:</p>

<pre><code>            key_one= int(raw_input("Enter key (0 &lt;= key &lt;= 127): "))#get the user to input the key number

            if key_one in range(128):# to see if the number that the user input is in the given range

                bin_key_one=bin(key_one)[2:]#change the number into binary and remove the 0b from it
                zeros_key=bin_key_one.zfill(7)#add 0 to the beganing og the binary if needed to make it 7-character length 
                print zeros_key
                massage= raw_input("Enter message to be encrypted: ")#get the user to input the massage they want
                for i in massage:
                    massage_ord=ord(i)
                    bin_massage=bin(massage_ord)[2:]
</code></pre>

<p>dont know what to do next!</p>

<p>I am trying to do the fallowing:</p>

<p>•   Get cipher key (assume user enters integer when prompted for key request)</p>

<p>•   Check that value entered is between 0 and 127 inclusive</p>

<p>•   Convert integer cipher key to binary string and strip off "0b"</p>

<p>•   Check for (and pad beginning with zeros if necessary)</p>

<p>•   Get message to be encrypted from standard input</p>

<p>•   Initialize encrypted message string to an empty string</p>

<p>•   Perform XOR operation on each binary bit of cipher key and message</p>

<p>o         Get integer ascii value of each character in message</p>

<p>o         Get binary value of ascii version of character and strip off "0b"</p>

<p>o         Check for 7-character length (pad beginning with zeros if necessary)</p>

<p>o         Perform XOR operation &amp; append binary 7-bit result to encrypted string</p>

<p>               Convert each binary bit of message character and key to an integer</p>

<p>               Perform XOR operation on these two bits</p>

<p>               Convert literal True and False to binary bit &amp; append to output</p>

<p>XOR can be logically implemented as follows:</p>

<p>(a and not b) or (not a and b)</p>

<p>can someone help plz</p>
