From 502bc3b296ccb9356cd77c2b738315be2ef579d7 Mon Sep 17 00:00:00 2001
From: Mike Salvatore <mike.s.salvatore@gmail.com>
Date: Tue, 4 May 2021 14:24:49 -0400
Subject: [PATCH] island: Enable standard mode with bcrypted passwords

---
 monkey/monkey_island/cc/environment/standard.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/monkey/monkey_island/cc/environment/standard.py b/monkey/monkey_island/cc/environment/standard.py
index 35ca84a34..7cca21c87 100644
--- a/monkey/monkey_island/cc/environment/standard.py
+++ b/monkey/monkey_island/cc/environment/standard.py
@@ -1,3 +1,5 @@
+import bcrypt
+
 from monkey_island.cc.environment import Environment
 from monkey_island.cc.resources.auth.auth_user import User
 
@@ -7,11 +9,10 @@ __author__ = "itay.mizeretz"
 class StandardEnvironment(Environment):
     _credentials_required = False
 
-    # SHA3-512 of '1234567890!@#$%^&*()_nothing_up_my_sleeve_1234567890!@#$%^&*()'
-    NO_AUTH_CREDS = (
-        "55e97c9dcfd22b8079189ddaeea9bce8125887e3237b800c6176c9afa80d2062"
-        "8d2c8d0b1538d2208c1444ac66535b764a3d902b35e751df3faec1e477ed3557"
-    )
+    NO_AUTH_USER = "1234567890!@#$%^&*()_nothing_up_my_sleeve_1234567890!@#$%^&*()"
+    NO_AUTH_SECRET = bcrypt.hashpw(
+        NO_AUTH_USER.encode("utf-8"), b"$2b$12$frH7uEwV3jkDNGgReW6j2u"
+    ).decode()
 
     def get_auth_users(self):
-        return [User(1, StandardEnvironment.NO_AUTH_CREDS, StandardEnvironment.NO_AUTH_CREDS)]
+        return [User(1, StandardEnvironment.NO_AUTH_USER, StandardEnvironment.NO_AUTH_SECRET)]