You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
public byte[] encrypt(byte[] plainText);
public byte[] decrypt(byte[] cipherText);
can we have
public byte[] encrypt(byte[] plainText, byte[] passwordOrKey);
public byte[] decrypt(byte[] cipherText, byte[] passwordOrKey);
which uses given password rather than from SharedPreference, I understand I can implement Custom KeyChain, however these API's are much simpler for the cases where encryption is based on inputs from user.
The text was updated successfully, but these errors were encountered:
I thought about this and I understand why this makes it simpler for your use case. However I think this API breaks the contract of Crypto and may make it more confusing to use for others. That is you pass in a keychain from which Crypto gets a key, but then the key is overriden by this API. It would also cause an explosion of methods in the case where if we have to do this for MACs as well. It would also prevents us from changing the algorithm in the future because some algorithms might supply more than 1 key as a parameter.
Hope this makes sense and represents compelling reasons not to add this API.
Since we API's like below
can we have
which uses given password rather than from SharedPreference, I understand I can implement Custom KeyChain, however these API's are much simpler for the cases where encryption is based on inputs from user.
The text was updated successfully, but these errors were encountered: