Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

22 řádky
482B

  1. package crypto
  2. import "errors"
  3. var ErrMissingAppSecret = errors.New("missing app secret")
  4. func Encrypt(secret, plaintext string) (string, error) {
  5. if secret == "" {
  6. return "", ErrMissingAppSecret
  7. }
  8. // TODO(milestone-6): replace with AES-GCM encryption.
  9. return plaintext, nil
  10. }
  11. func Decrypt(secret, ciphertext string) (string, error) {
  12. if secret == "" {
  13. return "", ErrMissingAppSecret
  14. }
  15. // TODO(milestone-6): replace with AES-GCM decryption.
  16. return ciphertext, nil
  17. }