web apps and natas

This commit is contained in:
Mari Wahl 2014-10-16 06:14:45 -04:00
parent 8c1733acda
commit fdbba7131b
19 changed files with 1888 additions and 18 deletions

View file

@ -1,25 +0,0 @@
package main
import (
"fmt"
"os"
)
func main() {
file, err := os.Open("ataylor.png")
if err != nil {
fmt.Println(err)
return
}
info, _ := os.Stat("ataylor.png")
input := make([]byte, info.Size())
out := make([]byte, len(input))
file.Read(input)
key := [...]byte{0x43, 0x53, 0x41, 0x57} // CSAW
for i := 0; i < len(input); i++ {
out[i] = input[i] ^ key[i%len(key)]
}
fmt.Println(string(out))
}