Does anyone have an encrypt and decrypt that can do sound files as well...ie..wav and mp3. I have one that uses binary but it can't handle wav or mp3.
Printable View
Does anyone have an encrypt and decrypt that can do sound files as well...ie..wav and mp3. I have one that uses binary but it can't handle wav or mp3.
Stupid Question: Why would you want to encrypt a sound (.wav, .mp3) file?
stupid answer:
I have a little app that encrypts and decrypts files and all files in folders and if when doing a folder, there is a sound file, the app blows up...I just thought it would be simpler if someone had something instead of my writing if statements and error handlers..
:D
...out and out lazyness....
Perhaps another stupid question: did you try Megatron's xor example?
Nope, but I'll look it up.
Encrypt an exe:
VB Code:
Sub Encrypt(ByVal sName As String) Dim b() As Byte Dim nb() As Byte n = FileLen(sName) ReDim b(n - 1) ReDim nb(n - 1) Open sName For Binary Access Read As #1 Get #1, , b() Close #1 Kill sName For i = LBound(b) To UBound(b) nb(i) = b(i) Xor 5 Next i Open sName For Binary Access Write As #1 Put #1, , nb() Close #1 End Sub
Usage
Encrypt "MyFile.exe"
Since this is Xor encryption, it will do both encrypting and decrypting.
I have a feeling this will work as it just xors the byte values, so I don't see how it could tamper with the sound file. If it works thank Megatron :)
Same scoop on sound files so I guess I'll have to get over my lazy attitude here and do a little work...thanks Nucleus and Megatron...nice little diddy...save it for future use as I already have a working encrypt and decrypt for this one.
Wayne,
I didn't understand, did it work?
I just tested it on my system and it works with wav files. I encrypted it, then decrypted it. It played the wav just fine.