| 139 | } |
| 140 | |
| 141 | func Example() { |
| 142 | const ( |
| 143 | key = 10 |
| 144 | input = "The Quick Brown Fox Jumps over the Lazy Dog." |
| 145 | ) |
| 146 | |
| 147 | encryptedText := Encrypt(input, key) |
| 148 | fmt.Printf("Encrypt=> key: %d, input: %s, encryptedText: %s\n", key, input, encryptedText) |
| 149 | |
| 150 | decryptedText := Decrypt(encryptedText, key) |
| 151 | fmt.Printf("Decrypt=> key: %d, input: %s, decryptedText: %s\n", key, encryptedText, decryptedText) |
| 152 | |
| 153 | // Output: |
| 154 | // Encrypt=> key: 10, input: The Quick Brown Fox Jumps over the Lazy Dog., encryptedText: Dro Aesmu Lbygx Pyh Tewzc yfob dro Vkji Nyq. |
| 155 | // Decrypt=> key: 10, input: Dro Aesmu Lbygx Pyh Tewzc yfob dro Vkji Nyq., decryptedText: The Quick Brown Fox Jumps over the Lazy Dog. |
| 156 | } |
| 157 | |
| 158 | func FuzzCaesar(f *testing.F) { |
| 159 | rnd := rand.New(rand.NewSource(time.Now().UnixNano())) |