-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openssl_encrypt($str, 'AES-128-ECB', $key, $padding) #14
Comments
Print the error hexStr := "13863dbecd8078bf2c8d4a795fe203e4"
decrypt := dongle.Decrypt.FromHexString(str).ByAes(cipher)
fmt.Println(decrypt.Error) |
php output:
golang output: There is no error message, but the result of Golang is inconsistent with that of Php. |
Golang use padding with Zero, php should also use padding with OPENSSL_ZERO_PADDING PHP OPENSSL_RAW_DATA be equal to dongle. No |
In addition, NoPadding requires that the encrypted string must be multiple of 16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following is the php implementation code
output:
13863dbecd8078bf2c8d4a795fe203e4
483
The following is the Go implementation code
output
Empty string
But I can't decrypt with go. How can I decrypt with go?
The text was updated successfully, but these errors were encountered: