-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement constant time decoding #123
Comments
Think about adding a static public class Base64(
config: Base64.Config
) : EncoderDecoder<Base64.Config>(config) {
// ...
public object Default {
@JvmField
public val CT: Base64 = Base64 {
lineBreakInterval = 64
constantTime = true
}
}
// ...
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add as a config option the ability to set constant time.
Some operations (e.g. encryption/decryption) require processing the entire contents of the input before throwing exception in order to mitigate timing attacks.
As module
:library:encoding-core
does not have knowledge of the higher level implementation details, this will need to be something added to them individually.EncoderDecoder
is configured for constant time and encounters an unrecognized input, it should substitute that unknown input so operations continue (e.g. characterTABLE[0]
) and set an error flag.Feed.doFinalProtected
is invoked, it should process the remaining contents in its buffer, and then throw an exception.flush()
should not produce an exception, only upon afterFeed.doFinal
is invoked. Implementations can checkisClosed
within theirdoFinalProtected
function to check whetherflush
ordoFinal
has been invoked.The text was updated successfully, but these errors were encountered: