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
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...
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...
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 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...
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)") =====================================================...
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...
The prompt for the python script is this: Construct a 99% confidence interval for the proportion...
The prompt for the python script is this: Construct a 99% confidence interval for the proportion of days with solar power generation above 43 kWh for City A (cityA>43.0). In order to perform this function, you need to make the appropriate modifications to the provided script. In other words, you should: Replace ???DATASET_NAME??? with solarkwh Replace '???VARIABLE_NAME???' with the variable 'cityA' Replace ???Xvalue??? with the appropriate value The code they give us: print ('Confidence Interval - Step 4') n =...
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...
10. Which of the following statements about python dictionary is correct? A. You can have different...
10. Which of the following statements about python dictionary is correct? A. You can have different types of data as keys in a dictionary. B. You can have variables as keys in a dictionary. C. The values (key-value pairs) in a dictionary must be the types of int or float. D. You cannot have a list as key in a dictionary.
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...