@@ -10,9 +10,8 @@ func (this *XOR) Decrypt(data []byte) (decrypted []byte, err error) {
|
||||
decrypted = make([]byte, len(data))
|
||||
for i := 0; i < len(data); i++ {
|
||||
decrypted[i] = data[len(data)-i-1] ^ this.key[i%len(this.key)]
|
||||
// decrypted[i] = data[i] ^ this.key[i%len(this.key)]
|
||||
// decrypted[i] = data[i]
|
||||
}
|
||||
// copy(decrypted,data)
|
||||
err = nil
|
||||
return
|
||||
}
|
||||
@@ -21,9 +20,8 @@ func (this *XOR) Encrypt(data []byte) (encryped []byte, err error) {
|
||||
encryped = make([]byte, len(data))
|
||||
for i := 0; i < len(data); i++ {
|
||||
encryped[len(data)-i-1] = data[i] ^ this.key[i%len(this.key)]
|
||||
// encryped[i] = data[i] ^ this.key[i%len(this.key)]
|
||||
// encryped[i] = data[i]
|
||||
}
|
||||
// copy(encryped,data)
|
||||
err = nil
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user