Verify takes passphrase, masterpassphrase and ciphertext as strings and returns error if verification fails, else returns nil upon success
(userpass, masterpass, ciphertext string)
| 73 | |
| 74 | // Verify takes passphrase, masterpassphrase and ciphertext as strings and returns error if verification fails, else returns nil upon success |
| 75 | func Verify(userpass, masterpass, ciphertext string) error { |
| 76 | parts := strings.Split(ciphertext, "$") |
| 77 | if len(parts) == 10 && parts[0] == "secBoxv1" { |
| 78 | return verifyV1(userpass, masterpass, parts) |
| 79 | } |
| 80 | return ErrCiphertextVer |
| 81 | } |
| 82 | |
| 83 | // GetHashVersion takes ciphertext string and returns goSecretBoxPassword version as int and error. |
| 84 | func GetHashVersion(ciphertext string) (version int, err error) { |