ESAPI Swingset Interactive - Integrity
Tutorial
Following methods from the ESAPI' Encryptor interface are used in the secure demo:
Create Seal
In the secure demo an integrity seal is created for the plain text entered by the user, the seal is set to be valid for 15 seconds by default.
seal = ESAPI.encryptor.seal( plaintext, instance.getTimeStamp() + 1000 * Integer.parseInt(timer) );
Verify Seal:
The call to the following method will return true if the seal is verified within 15 seconds.
boolean verified = ESAPI.encryptor.verifySeal( toVerify );
Unseal:
The call to the following method will unseal it back to the plain text if it is done within 15 seconds.
plaintext = ESAPI.encryptor.unseal(sealed);
OWASP Enterprise Security API Project