Encrypt password in groovy

1

I am developing an application that will have a login screen that will be based on data (user, password) already saved in a MySQL database, / em> that was used the first time to encrypt the user's password to validate if the user who is trying to access the application is already registered in the bank. It is the first time that I do something related to password encryption, so when searching the subject I found this and this related content to encrypt the password in JAVA , but whenever I try to test the codes indicated in links this part of the code already accuses an script error in Groovy :

MessageDigest algorithm = MessageDigest.getInstance("MD5");
byte messageDigest[] = algorithm.digest("senha".getBytes("UTF-8")); \O erro é na palavra byte mostra um erro

Error displayed:

Groovy:Primitive type literal: byte cannot be used as a method name at line: 22 column: 1. File:C:\BonitaBPMCommunity-7.3.3\workspace\default\src-providedGroovy\acript1494448116792.groovy @ line 22, column 1.

If you have a hint how can I encrypt a variable of type string via script Groovy .

    
asked by anonymous 10.05.2017 / 22:33

0 answers