Passwords should be wiped from memory partial implementation#52
Passwords should be wiped from memory partial implementation#52giusvale-dev wants to merge 8 commits intojorabin:developfrom
Conversation
|
Hi again Giuseppe Thanks for this PR which came as a bit of a surprise, especially since it comes so soon after your last contribution! There are two different aspects to this.
I very much appreciate your wanting to address this, and hurrying to do so. However, as the Romans said "festina lente". Not as slowly as I have been hurrying, admittedly, but let's think carefully about making things better. And do it once. I am going to hold off on merging your PR for now, till we have thought about this a bit more, and in particular, thought about:
Let's continue this discussion under Issue #28 and decide with the help of anyone who cares to contribute, what we should do next. A couple of other things:
Thank you for your contribution, I really appreciate your activity! I regret not adopting your PR, but hope you'll see why? Jo |
|
Hi Jo, Don't worry about rejecting this PR, we will make it together after further analysis (we will continue our discussion in #28). Indeed there are many points to clarify (as you have seen in my PR comment), and I agree with your last comment. I meant to do a few PRs to solve this hard task, but is better to clarify before all the points. Giuseppe |
Updated Password Handling: Transitioning to
byte[]for Enhanced SecurityI have introduced changes to facilitate password handling using
byte[]arrays in place ofStringobjects.Key Changes:
EntryInterface andAbstractEntryClass Update:Entryinterface and theAbstractEntryclass have been thoughtfully adjusted to accommodate the migration towardsbyte[]arrays for password management.byte[]arrays.AbstractEntrynow include implementations of thegetPropertyAsBytesmethod.Work in Progress:
Prior to proceeding with further code implementation, I believe it's essential to gather your valuable feedback. The following steps are on the horizon:
Implementing an Obfuscation Strategy:
Before progressing, I intend to establish a robust obfuscation strategy to bolster security.
Assessing Source Code Updates:
Subsequently, we can evaluate the integration of these changes into the source code, particularly within the serialization and deserialization processes.
Security Considerations:
For example, when examining serialization/deserialization methods, we allocate the protected value as plaintext in memory, and when using setter methods, we add this value to other objects allocated in the heap. Consequently, the protected information is stored in clear text within the heap, whether obfuscated or not.
I have provided a simple code snippet to illustrate this point, and I've added comments to my source code to further clarify this behavior.
Your input and insights are pivotal at this stage as we strive to fortify security and maintain the codebase's integrity.
ORIGINAL CODE
POSSIBLE UPDATE CODE