-
Notifications
You must be signed in to change notification settings - Fork 33
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
add the capability to add padding for the hash traqnsformations (md5, ...) #11
Comments
Hello, @terefang thanks for the suggestion. |
there are many types of padding but all rely on the block-size of the hash-function as a parameter Zero Byte Padding (ISO/IEC 10118-1 and ISO/IEC 9797-1)from 0 to BS-1 zero bytes are added as padding so for the byte sequence "s3cr3tPa55w0rd" (14 bytes)
as padding.
|
ANSI X9.23 Paddingfrom 1 to BS bytes are added as padding, all added bytes are zero except the last byte which is set to the total number of bytes padded. so for the byte sequence "s3cr3tPa55w0rd" (14 bytes)
padding bytes will always be added
|
PKCS#5, PKCS#7, RFC 5652 Paddingfrom 1 to BS bytes are added as padding, all added bytes are set to the total number of bytes padded. so for the byte sequence "s3cr3tPa55w0rd" (14 bytes)
padding bytes will always be added
|
ISO/IEC 7816-4:2005 Paddingfrom 1 to BS bytes are added as padding, the first byte is set to so for the byte sequence "s3cr3tPa55w0rd" (14 bytes)
padding bytes will always be added
|
@terefang Apologies for my asking, as I'm quite new to all of this stuff and I would like to help to the best of my ability, but is |
@itslychee yes, of course, the crypto packages of go are implemented as required by the individual algorithms. Otherwise, IMHO, they would be pretty useless. @terefang, I honestly don't understand exactly what you're getting at. The noted zero-padding was an example implementation of mine to give an example of the new processor design. It simply prepends a fixed number of zeros to a number. Actually, the implementation is not even good, it would be better to specify the desired "width" of the number and then prepend a corresponding number of zeros. However, I haven't had time to tackle this yet. |
an overview of standardized paddings is here https://en.wikipedia.org/wiki/Padding_%28cryptography%29
i saw the for 0.2 zero-padding has been merged
this enhancement request would rely upon that capability
The text was updated successfully, but these errors were encountered: