HDIV cipher tag not working

94 Views Asked by At

I'm trying to cipher a parameter using HDIV's cipher tag. I have tried the example from the following page https://github.com/hdiv/hdiv/wiki/05.-HDIV-Tag-Libraries#5113-tag-cipher.

According to the documentation

<input type="hidden" name="p1" value="<hdiv:cipher parameter="p1" value="v1"/>"/>

Should give the result

<input type="hidden" name="p1" value="0"/>

However I am getting

<input type="hidden" name="p1" value="v1"/>

And nothing is ciphered/hidden away.

Is there a piece of configuration that I need?

I am using HDIV 3.2.0

1

There are 1 best solutions below

1
gillarramendi On

Are you including the <hdiv:cipher> tag inside a form? For example a <form:form> tag in Spring MVC.

The cipher tag is designed to add new parameters to an existing form, so you have to include it inside a form tag.

Another thing to check is confidentiality configuration option inside Hdiv configuration. If it is disabled, you won't get the confidential value 0 but the real value v1.