Question

Given the following Python script. import base64 secret_data = "Malware, you can run but you can't...

Given the following Python script.

import base64

secret_data = "Malware, you can run but you can't hide"

b32encoded_data=base64.b32encode(secret_data.encode('utf-8'))

b64encoded_data=base64.b64encode(secret_data.encode('utf-8'))

a85encoded_data=base64.a85encode(secret_data.encode('utf-8'))

Write the value of the following variables:

  1. b32encoded_data
  2. b64encoded_data
  3. a85encoded_data

Homework Answers

Answer #1

Code:

# importing the package
import base64

# message to encode
secret_data = "Malware, you can run but you can't hide"

# encoding messages in different encodings using base64 package
b32encoded_data=base64.b32encode(secret_data.encode('utf-8'))
b64encoded_data=base64.b64encode(secret_data.encode('utf-8'))
a85encoded_data=base64.a85encode(secret_data.encode('utf-8'))

# to get the value we print the data in the variabels
print('Data in variable "b32encoded_data":', b32encoded_data)
print('Data in variable "b64encoded_data":', b64encoded_data)
print('Data in variable "a85encoded_data":', a85encoded_data)

Data in variable "b32encoded_data": b'JVQWY53BOJSSYIDZN52SAY3BNYQHE5LOEBRHK5BAPFXXKIDDMFXCO5BANBUWIZI='
Data in variable "b64encoded_data": b'TWFsd2FyZSwgeW91IGNhbiBydW4gYnV0IHlvdSBjYW4ndCBoaWRl'
Data in variable "a85encoded_data": b'9jqj^@<,p1+F.mJ+Ceht+EDUB+C]J8+F.mJ+Ceht-ZgJEBk1c'

FOR HELP PLEASE COMMENT.
THANK YOU

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
PYTHON SCRIPT Your parents pay you $3 for each trash bag full of leaves you take....
PYTHON SCRIPT Your parents pay you $3 for each trash bag full of leaves you take. If you can fill more than 10 bags in a month, they give you a bonus of $20. Write a program that asks the user how many bags of leaves they filled in the past month and prints out the total amount of money they made. For example, if someone fills 8 bags in a month, they would get $24. But, if they fill...
Consider the following python script mt_q2.py, which defines the function called now(): #!/usr/bin/env python3 # program:...
Consider the following python script mt_q2.py, which defines the function called now(): #!/usr/bin/env python3 # program: mt_q2.py import os def now():     p = os.popen('date +%Y%m%d')     today = p.read().strip()     return today if __name__ == '__main__':     print(now()) Asnwer the following questions: (a) What type of object will be returned by the now() function? (b) If you run the above Python script "python3 mt_q2.py" on a system with real-time clock on Oct 16, 2019 at 10:00 am, what will...
The first script you need to write is login.sh, a simple script that you might run...
The first script you need to write is login.sh, a simple script that you might run when you first log in to a machine. We'll expand this script later, but for now it should include your name, username, hostname, current directory, and the current time. Here is some sample output to help guide you. Note that the bolded lines that start with "[user@localhost ~]$" are the terminal prompts where you type in a command, not part of the script. Of...
PYTHON script for the following things: Creates a variable and stores a string value that is...
PYTHON script for the following things: Creates a variable and stores a string value that is at least 8 characters long. Displays the value of the variable to the screen. Displays the length of the string using the len() function. Displays the last 3 characters of the string by using the substring() function. Creates a list containing 8 elements (numbers or strings) and displays the list using the print() function.
The below code will create a data fram for you. You need to first run the...
The below code will create a data fram for you. You need to first run the below code and then answer the following questions. # RUN THIS CELL AFTER ADDING YOUR STUDENT NUMBER import pandas as pd import numpy as np my_student_number = np.random.seed(my_student_number) df = pd.DataFrame ({'action': ['BUY']*4+['SELL']*4,                     'A': np.random.randint(20,45,8),                     'B': np.random.randint(50,100,8),                     'C': np.random.randint(110,140,8)}) The above df holds the buy/sell prices of three diferent stocks, A, B, and C recorded over a day. By assuming that you have already...
FYI DB=database_Streaming_Service_GoFlix; I am running the following script to connect through python: =========================================================== import pyodbc conn...
FYI DB=database_Streaming_Service_GoFlix; I am running the following script to connect through python: =========================================================== import pyodbc conn = pyodbc.connect("Driver={ODBC Driver 17 for SQL Server};"                       "Server=test;"                       "Database=database_Streaming_Service_GoFlix;"                       "Trusted_Connection=yes;") cursor = conn.cursor() cursor.execute('SELECT * FROM database_Streaming_Service_GoFlix') for row in cursor:     print('row = %r' % (row,)) ======================================== Output: Traceback (most recent call last): File "C:\Users\test\AppData\Local\Programs\Python\Python39\Scripts\db_connect.py", line 10, in <module>     cursor.execute('SELECT * FROM database_Streaming_Service_GoFlix') pyodbc.ProgrammingError: ('42S02', "[42S02] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name 'database_Streaming_Service_GoFlix'. (208) (SQLExecDirectW)") =====================================================...
PYTHON SCRIPT Your parents have promised to buy you a game system depending on your grade...
PYTHON SCRIPT Your parents have promised to buy you a game system depending on your grade point average (GPA). If your GPA is in between 3.0 and 3.5, inclusive, then you will get a Wii. If your GPA is greater than 3.5 but less than or equal to 3.8, you will get a Kinect. If your GPA is greater than 3.8, you will get a Playstation 3. Write a program that prompts the user for their GPA and prints out...
Python Script You only get to go on your field trip if you bring back a...
Python Script You only get to go on your field trip if you bring back a signed permission slip. If you get to go on the field trip, you get to choose between going to the history museum and the art museum. In your program, ask the user if they've brought back a signed permission slip. If they have, then ask them a history question. If they get it right, then tell them that they are going to the history...
Write a Bash shell script highestTest.sh that will determine the highest value given to the script....
Write a Bash shell script highestTest.sh that will determine the highest value given to the script. It should take in as a command-line argument a series of numbers. This list could be of any length. Your script should start by finding the lowest value in the list of values. Then it should find how many times that value appears in total in the list. It should then output those results. In addition, I want you to detect if any fractional...
You will utilize your Python environment to derive structure from unstructured data. You will utilize the...
You will utilize your Python environment to derive structure from unstructured data. You will utilize the given data set. Using this data set, you will create a text analytics Python application that extracts themes from each comment using term frequency–inverse document frequency (TF–IDF) or simple word counts. For the deliverable, provide your Python file and a .csv with your results added as a column to the original data set. * I am unable to provide the data set itself, as...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT