php - How to decrypt SSN field from DB that is encrypted using Crypt::encrypt in Laravel? -
i trying create web service passing id, username, ssn input parameters , retrieve required information of particular user in json response.
i can create db query gather user data , filter query result based on id, username. but, ssn encrypted using crypt::encrypt() , stored in database. have decrypt value , match user entered ssn in input parameter.
i tried using crypt::decrypt()
in clause of db query didn't work out. how decrypt ssn in such situation?
my original query is:
$ssn = 123456789; $res = db::table('users') ->where('users.ssn', '=', $ssn) ->select('users.ssn ssn') ->get();
i tried decrypt ssn db:
$res = db::table('users') ->where('crypt::decrypt(users.ssn)', '=', $ssn) ->select('users.ssn ssn') ->get();
wiki
Comments
Post a Comment