how to search encrypted data in grails

268 views Asked by At

I have domain with 3 field cardNo, cardName and account

class card {
    String cardNo
    String cardName
    Account account

static constraints = {
    cardNo(blank:false, unique:true)
    cardName(blank:false)
    account(blank:false)
}

The cardNo must be encrypted when saved, I used encryptionUtil Java to encrypt it. On my list screen, I want to make search fiture, which can be search by cardNo and cardName. Is it possibe if I search data encrypted with create cretiria in grails?? If can't use create criteria, what is the best way to search encrypted data?? Need your help. thanks before :)

1

There are 1 answers

1
Mr. Cat On

I can give you an advice: avoid store card numbers in your database. Use payment services for it.