-
Notifications
You must be signed in to change notification settings - Fork 255
Base64 should be open for different alphabets #24
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
Conversation
garydgregory
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs unit tests ;-)
|
You´re right. I made the byte arrays of the alphabets When my personal project with the shadow table is finished I´d like to add the crypt table. |
|
Hm.... I´ve no idea why the travis build fails. I work on Corretto JDK 11 and my maven build succeeds?! works on my system. |
|
Okay... can reproduce the error - but it´s no fault in my changes. |
|
I think the build fails because the maven-javadoc-plugin configuration section in build does not have this: The plugin is configured in commons-parent. It has this tag for the reporting section and the release profile but not for the build section. @cljk Can you confirm that you cannot do this with Corretto JDK 11: This should work: On the code change, do not make the array public. The values are mutable. Copy the array to the unit test or provide a package private level static getter which returns a clone of the array. You should also change the public constructor that accepts an input alphabet to check it has 64 characters. I'm not sure where we are with defensive copying of input arrays so I'll leave that judgement for someone else. |
…stom encode table
|
@aherbert fails, works... But perhaps we should open an issue for that since that´s not caused by my pull request?!
" defensive copying of input arrays" - If you think making a duplicate of the encodeTable improves security in any way (?)... adding this would be a one-liner?! |
|
@garydgregory this can be closed, as my PR got merged :) |
|
Closing since #266 is merged. |
Currently I´m trying to write a Linux shadow-file - the passwords are stored as Base64-ecoded (hashes). But the alphabet of this Base64 is different:
see www.linuxquestions.org/questions/linux-security-4/how-can-i-convert-a-sha-512-etc-shadow-hash-to-base64-4175477045/
A base 64 encoding is used to store password hashes computed with crypt in the /etc/passwd. Its alphabet starts with '.' for zero, then '/' for one, followed by 0-9, A-Z and a-z. Padding is not used.So I opened up your Base64 class constructor to accept an alphabet.