Results 1 to 8 of 8

Thread: < encrypt decrypt >

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    < encrypt decrypt >

    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.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  2. #2
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    Stupid Question: Why would you want to encrypt a sound (.wav, .mp3) file?

  3. #3

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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..



    ...out and out lazyness....
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Perhaps another stupid question: did you try Megatron's xor example?

  5. #5

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Nope, but I'll look it up.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Encrypt an exe:

    VB Code:
    1. Sub Encrypt(ByVal sName As String)
    2.     Dim b() As Byte
    3.     Dim nb() As Byte
    4.     n = FileLen(sName)
    5.     ReDim b(n - 1)
    6.     ReDim nb(n - 1)
    7.     Open sName For Binary Access Read As #1
    8.     Get #1, , b()
    9.     Close #1
    10.     Kill sName
    11.     For i = LBound(b) To UBound(b)
    12.         nb(i) = b(i) Xor 5
    13.     Next i
    14.  
    15.     Open sName For Binary Access Write As #1
    16.     Put #1, , nb()
    17.     Close #1
    18. 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

  7. #7

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  8. #8
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width