![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 29.10.2019 02:31 cjjudecjude5675
Use the instructor provided xor code to implement a scheme that allows you to encrypt and decrypt some data using symmetric encryption principles.
-you can implement any scheme that you want. either one of the schemes discussed in the class or a new one that you designed on your own.
-the key aspect is that you should generate several blocks from the input and you should do several rounds of encoding.
-implement the python code and show your results.
here is the provided code:
## xor script
from os import urandom
def genkey(length):
return bytearray(urandom(lenght))
def encrypt(plaintext, key):
return bytearray([ ord(plaintext[i]) ^ key[i] for i in range(len(
def main():
mymessage = "this is the plain text"
key = genkey
cipher = encrypt(mymessage, key)
print str(cipher)
decrypted_message = decrypt(cipher, key)
print decrypted_message
if decrypted (encrypt(mymessage, key) , key ) == mymessage:
print "it works"
else:
print "somthing failed"
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 10:00
According to alisa miller foreign news bureaus
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 14:30
Ahousehold consists of a married couple and their twin five-year old daughters. the couples children had no income and lived with their parents all of last year. how many exemptions can the couple claim on last years tax return or they file with the “ married filing jointly “ status? a. 4 b. 5 c. 3 d. 2
Answers: 1
You know the right answer?
Use the instructor provided xor code to implement a scheme that allows you to encrypt and decrypt so...
Questions
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/geografiya.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 15.05.2021 02:10
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/istoriya.png)
History, 15.05.2021 02:10
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 15.05.2021 02:10
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/es.png)
![question](/tpl/images/cats/himiya.png)
Chemistry, 15.05.2021 02:10
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 15.05.2021 02:10