Created
January 27, 2023 20:05
-
-
Save alberic89/b06aeaa58f514b42be7e073e3f7e1899 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wave | |
string_data = input("Please enter the string to encrypt: ") | |
encrypted_data = bytes(string_data, 'utf-8') | |
# Write the encrypted data to a new audio file | |
new_audio_file = wave.open('tmp.wav', 'wb') | |
new_audio_file.setparams((1, 2, 44100, 0, 'NONE', 'NONE')) | |
new_audio_file.writeframes(encrypted_data) | |
new_audio_file.close() | |
f = wave.open('tmp.wav', 'rb') | |
string_data = f.readframes(f.getnframes()) | |
f.close() | |
print(string_data.decode('utf8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment