This is proving to be a rough transition over to python. What is going on here?:
f = open( 'myfile', 'a+' )
f.write('test string' + '
')
key = "pass:hello"
plaintext = subprocess.check_output(['openssl', 'aes-128-cbc', '-d', '-in', test, '-base64', '-pass', key])
print (plaintext)
f.write (plaintext + '
')
f.close()
The output file looks like:
test string
and then I get this error:
b'decryption successful
'
Traceback (most recent call last):
File ".../Project.py", line 36, in <module>
f.write (plaintext + '
')
TypeError: can't concat bytes to str
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…