| 发表于:2008-02-02 13:53:076楼 得分:0 |
dim a() as byte private sub encode() open "c:\test\01.mp3" for binary as #1 redim a(lof(1) - 1) get #1, , a close #1 call code open "c:\test\01.enc" for binary as #1 put #1, , a close #1 kill "c:\test\01.mp3" end sub private sub decode() open "c:\test\01.dec" for binary as #1 redim a(lof(1) - 1) get #1, , a close #1 call code open "c:\test\01.mp3" for binary as #1 put #1, , a close #1 end sub private sub code() dim key(7) as byte, i as integer key(0) = &h20 key(1) = &h8 key(2) = &h2 key(3) = &h2 key(4) = &h13 key(5) = &h39 key(6) = &h24 key(7) = &h25 for i = 0 to 1023 step 8 a(i) = a(i) xor key(0) a(i + 1) = a(i + 1) xor key(1) a(i + 2) = a(i + 2) xor key(2) a(i + 3) = a(i + 3) xor key(3) a(i + 4) = a(i + 4) xor key(4) a(i + 5) = a(i + 5) xor key(5) a(i + 6) = a(i + 6) xor key(6) a(i + 7) = a(i + 7) xor key(7) next i end sub | | |
|