Improve crypto hashing APIs to add salt #1517
Labels
Area/Security
Issues related to stdlib security
module/crypto
Team/PCM
Protocol connector packages related issues
Type/Improvement
Milestone
Description:
The current hashing APIs of
ballerina/crypto
library does not support to add "salt".Ex.
crypto:hashSha256(password)
It would better to improve the existing APIs for the above use case.
Suggested API:
public isolated function hashSha256(byte[] input, byte[] salt) returns byte[]
Java Implementation:
With this approach, there can be another requirement for the use cases of secure random generators. Refer to the "Secure Random Number" section under "Crypto" tab of "[Research] Comparison on Ballerina Security Features / APIs" [1].
Also, there should be a hash verification API as well.
[1] https://docs.google.com/spreadsheets/d/1PyMAlAvgkEL0RpW8CVUj1ccW_61Vm6SMbvadFVYRpSA/edit?usp=sharing
The text was updated successfully, but these errors were encountered: