how can I encrypt audio file or signal using xor

2 vues (au cours des 30 derniers jours)
davidop
davidop le 4 Avr 2016
Commenté : Elyaser Ben Guno le 9 Août 2020
Processes involves, inputing audio on matlab, converting it to binary form (matrix) then encrypting using XOR (probably an otp)
  5 commentaires
davidop
davidop le 6 Avr 2016
Modifié(e) : davidop le 6 Avr 2016
I wish to store the audio as both data file and audio file since I would love to listen to the encrypted file and also decrypt it @Roberson
akshatha Sushma
akshatha Sushma le 5 Avr 2018
can u please share the code for xoring the binary form of .wav into cipher text?

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Avr 2016
Use the 'uint8' option of getaudiodata(): you can xor against that.
repmat() your key as many times as you need to be exactly as long as your binary signal, and then you can xor on that.
  4 commentaires
Walter Roberson
Walter Roberson le 9 Août 2020
Audio files do not require double / floating point to be played.
You read (most) audio files as integer instead of double by adding the option 'native' top audioreader()
You can pass uint8 data to audiowriter() and it will write them to the file.
You can play uint8 data with audioplayer()
Elyaser Ben Guno
Elyaser Ben Guno le 9 Août 2020
thanks sir, it works

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by