diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py
index 997eec08..06c763db 100644
--- a/pylib/gyp/generator/make.py
+++ b/pylib/gyp/generator/make.py
@@ -1774,7 +1774,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
 
       # Hash the target name to avoid generating overlong filenames.
       cmdstring = (command if command else self.target).encode('utf-8')
-      cmddigest = hashlib.sha1(cmdstring).hexdigest()
+      cmddigest = hashlib.sha1(cmdstring, usedforsecurity=False).hexdigest()
       intermediate = "%s.intermediate" % (cmddigest)
       self.WriteLn('%s: %s' % (' '.join(outputs), intermediate))
       self.WriteLn('\t%s' % '@:');
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
index bf04e567..631ef7f2 100644
--- a/pylib/gyp/generator/ninja.py
+++ b/pylib/gyp/generator/ninja.py
@@ -751,7 +751,7 @@ class NinjaWriter(object):
         if self.flavor == 'win':
           # WriteNewNinjaRule uses unique_name for creating an rsp file on win.
           extra_bindings.append(('unique_name',
-              hashlib.md5(outputs[0]).hexdigest()))
+              hashlib.md5(outputs[0], usedforsecurity=False).hexdigest()))
 
         self.ninja.build(outputs, rule_name, self.GypPathToNinja(source),
                          implicit=inputs,
@@ -2388,7 +2388,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
     qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name,
                                                            toolset)
     qualified_target_for_hash = qualified_target_for_hash.encode('utf-8')
-    hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest()
+    hash_for_rules = hashlib.md5(qualified_target_for_hash, usedforsecurity=False).hexdigest()
 
     base_path = os.path.dirname(build_file)
     obj = 'obj'
