When a user try to access the web application , system would promt to enter user name and password for existing user and create new username and password for new users in the K2 smartform:
I need to :
1. when new user enter the password and confirm password for the first time , it need to be compared whether the value match between the two input fields to continue.
2. if the password values match then it needs to be convert it in to MD5 hash before updating the password in the DB table.
Any idea would be helpful.
It sounds like you are building an anonymous SmartForm that receives a username and password which is used for validation before loading the rest of the form.
We would recommend not building such a solution as subsequent HTTP requests would be done in an anonymous and unauthenticated way which could result in security issues.
Rather make use of the built in authentication mechanisms available in the product, such as SQLUM: https://help.k2.com/onlinehelp/k2five/icg/current/default.htm#Configure/UM-SQLUM.htm, which will make sure every HTTP request validates that the user is authenticated.
To answer your direct question, there is nothing "Out of the box" that allows you to covert input values to MD5 hash and to accomplish something like that, SmartObject Service types like SQL Server Service, REST, Endpoint WebService or Endpoint Assembly should be used.
I hope this helps.