Index: app/Http/Controllers/SessionsController.php
===================================================================
--- app/Http/Controllers/SessionsController.php	(revision 092fcda5a2f36c7ffda321a50fac25284a159d9c)
+++ app/Http/Controllers/SessionsController.php	(revision 8a258ab3815610fee8b74d07462345ce5e158af2)
@@ -8,7 +8,14 @@
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Session;
+use Illuminate\Support\Facades\Hash;
 
 class SessionsController extends Controller
 {
+    function verifyPassword($inputPassword, $storedHash, $salt)
+    {
+        $hashedInputPassword = crypt($inputPassword . $salt, $storedHash);
+
+        return $hashedInputPassword === $storedHash;
+    }
     public function store()
     {
@@ -29,7 +36,10 @@
         if($is_officer!=null) {
             $pass = DB::select('select o_password from officer where o_badge_no = :o_badge_no;', ['o_badge_no' => $badge_no]);
+            $salt = DB::select('select salt from officer where o_badge_no = :o_badge_no;', ['o_badge_no' => $badge_no]);
             $policeman = false;
         } else {
             $pass = DB::select('select p_password from policeman where badge_no = :badge_no;', ['badge_no' => $badge_no]);
+            $salt = DB::select('select salt from policeman where badge_no = :badge_no;', ['badge_no' => $badge_no]);
+
         }
 
@@ -38,6 +48,9 @@
             break; // Break after the first key-value pair
         }
-
-        if ($value == $password) {
+        foreach ($salt[0] as $key => $val) {
+            $value2 = $val;
+            break; // Break after the first key-value pair
+        }
+        if ($this->verifyPassword($password, $value, $value2)) {
             // Authentication passed
             Session::put('badge_no', $badge_no);
