Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

22 lignes
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. }