Abstract:
 
Hardcoded 加密密钥可能会削弱系统安全性,一旦出现安全问题将无法轻易修正。
 
 
Explanation:
 
请勿对加密密钥进行硬编码,因为这样所有项目开发人员都能查看该加密密钥,而且还会大大增加解决问题的难度。一旦代码被使用,除非对软件进行修补,否则加密密钥将再也不能更改。如果受加密密钥保护的帐户遭受入侵,系统所有者将被迫在安全性和可用性之间做出选择。
 
 
例 1:下列代码使用了硬编码加密密钥:
 
 
...
private static final String encryptionKey = "lakdsljkalkjlksdfkl"; byte[] keyBytes = encryptionKey.getBytes(); SecretKeySpec key = new SecretKeySpec(keyBytes, "AES"); Cipher encryptCipher = Cipher.getInstance("AES"); encryptCipher.init(Cipher.ENCRYPT_MODE, key);
...
 
 
任何可访问该代码的人都能访问加密密钥。一旦应用程序发布,除非对程序进行修补,否则将无法更改加密密钥。雇员可以利用手中掌握的信息访问权限入侵系统。更糟糕的是,如果攻击者可以访问应用程序的可执行文件,就可以提取加密密钥值。
 
 
 
Instance ID: 8769D69879B813A4804A88C0B1B9F349
 
Priority Metadata Values:
 
            IMPACT: 3.0
 
            LIKELIHOOD: 3.2
 
Legacy Priority Metadata Values:
 
            SEVERITY: 4.0
 
            CONFIDENCE: 5.0
 
 
Remediation Effort: 3.0
 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
Recommendations:
 
请勿对加密密钥进行硬编码,而应对加密密钥加以模糊化,并在外部资源文件中进行管理。如果在系统中采用明文的形式存储加密密钥,任何有足够权限的人即可读取加密密钥,还可能误用这些密码。
 
 
References:
 
 
[2] Standards Mapping - Common Weakness Enumeration, CWE ID 321
 
[3] Standards Mapping - FIPS200, IA
 
[4] Standards Mapping - NIST Special Publication 800-53 Revision 4, SC-12 Cryptographic Key Establishment and Management (P1)
 
[5] Standards Mapping - OWASP Mobile Top 10 Risks 2014, M6 Broken Cryptography
 
[6] Standards Mapping - OWASP Top 10 2004, A8 Insecure Storage
 
[7] Standards Mapping - OWASP Top 10 2007, A8 Insecure Cryptographic Storage
 
[8] Standards Mapping - OWASP Top 10 2010, A7 Insecure Cryptographic Storage
 
[9] Standards Mapping - OWASP Top 10 2013, A6 Sensitive Data Exposure
 
[10] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1, Requirement 6.5.8, Requirement 8.4
 
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2, Requirement 6.3.1.3, Requirement 6.5.8, Requirement 8.4
 
[12] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0, Requirement 6.3.1, Requirement 6.5.3, Requirement 8.4
 
[13] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0, Requirement 6.3.1, Requirement 6.5.3, Requirement 8.2.1
 
[14] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1, Requirement 6.3.1, Requirement 6.5.3, Requirement 8.2.1
 
[15] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2, Requirement 6.3.1, Requirement 6.5.3, Requirement 8.2.1
 
[16] Standards Mapping - SANS Top 25 2009, Porous Defenses - CWE ID 259
 
[17] Standards Mapping - SANS Top 25 2010, Porous Defenses - CWE ID 798
 
[18] Standards Mapping - SANS Top 25 2011, Porous Defenses - CWE ID 798
 
[19] Standards Mapping - Security Technical Implementation Guide Version 3.1, APP3210.1 CAT II, APP3350 CAT I
 
[20] Standards Mapping - Security Technical Implementation Guide Version 3.10, APP3210.1 CAT II, APP3350 CAT I
 
[21] Standards Mapping - Security Technical Implementation Guide Version 3.4, APP3210.1 CAT II, APP3350 CAT I
 
[22] Standards Mapping - Security Technical Implementation Guide Version 3.5, APP3210.1 CAT II, APP3350 CAT I
 
[23] Standards Mapping - Security Technical Implementation Guide Version 3.6, APP3210.1 CAT II, APP3350 CAT I
 
[24] Standards Mapping - Security Technical Implementation Guide Version 3.7, APP3210.1 CAT II, APP3350 CAT I
 
[25] Standards Mapping - Security Technical Implementation Guide Version 3.9, APP3210.1 CAT II, APP3350 CAT I
 
[26] Standards Mapping - Security Technical Implementation Guide Version 4.1, APSC-DV-002010 CAT II
 
[27] Standards Mapping - Web Application Security Consortium Version 2.00, Information Leakage (WASC-13)
 
 
 
 

Key Management: Hardcoded Encryption key 密钥管理:硬编码加密密钥的更多相关文章

  1. Fortify漏洞之Dynamic Code Evaluation: Code Injection(动态脚本注入)和 Password Management: Hardcoded Password(密码硬编码)

    继续对Fortify的漏洞进行总结,本篇主要针对  Dynamic Code Evaluation: Code Injection(动态脚本注入) 和 Password Management: Har ...

  2. Qwiklab'实验-Hadoop, IoT, IAM, Key Management'

    title: AWS之Qwiklab subtitle: 1. Qwiklab'实验-Hadoop, IoT, IAM, Key Management Service' date: 2018-09-1 ...

  3. Password Management:Hardcoded Password 密码管理:硬编码密码

  4. 密码硬编码(Password Management: Hardcoded Password)

    在对项目进行安全扫描时,发现一些密码硬编码问题,本文主要三个方面:1)什么是密码硬编码:2)密码硬编码的危害:3)密码硬编码的解决方案. 一 什么是密码硬编码 将密码以明文的形式直接写到代码中,就是密 ...

  5. Note: Secure Deduplication with Efficient and Reliable Convergent Key Management (Dekey)

    原文献:Secure Deduplication with Efficient and Reliable Convergent Key Management Dekey包含三个实体:用户(Users) ...

  6. CodeIgniter 错误: In order to use the Session class you are required to set an encryption key

    CodeIgniter SESSION  第一次用 session 遇到这个错误 , 说是要加一个密钥才可以使用,加就加吧, 打开 config.php 找到以下代码 /*|------------- ...

  7. Google Ads Encryption Key

    aes | floyd's Google Ads Encryption Key

  8. 用XCA(X Certificate and key management)可视化程序管理SSL 证书(3)--创建自己定义的凭证管理中心(Certificate Authority)

    在第"用XCA(X Certificate and key management)可视化程序管理SSL 证书(2)---创建证书请求"章节中,我们介绍了怎样用XCA创建SSL证书请 ...

  9. 用XCA(X Certificate and key management)可视化程序管理SSL 证书(2)--生成SSL证书请求

    在上个章节中,我们提到了怎样安装XCA(X Certificate and key management)程序.这个章节我们開始正式介绍怎样用XCA生成证书请求.假设大家用过java的话.肯定知道jd ...

随机推荐

  1. linux进程间通信之共享内存学习记录

    进程 狭义定义:进程是正在运行的程序的实例(an instance of a computer program that is being executed). 广义定义:进程是一个具有一定独立功能的 ...

  2. #华为云·寻找黑马程序员#微服务-你真的懂 Yaml 吗?

    在Java 的世界里,配置的事情都交给了 Properties,要追溯起来这个模块还是从古老的JDK1.0 就开始了的. "天哪,这可是20年前的东西了,我居然还在用 Properties. ...

  3. 在Eclipse中混合Java和Scala编程

    1. 新建项目目录 scala-java-mix 2. 创建 src 目录及子目录: mkdir -p src/main/java mkdir -p src/main/scala 3. 在目录 sca ...

  4. MySQL必知必会(Select, Where子句)

    SELECT prod_name, prod_price FROM products WHERE prod_price = 2.5; SELECT prod_name, prod_price FROM ...

  5. mysql-常用组件之触发器

    基本概念 触发器是一种特殊的存储过程,不像存储过程需要显示调用,触发器通过监控表事件(增删改操作)自动触发某条 sql 的执行,可以用于购物车加购后库存减少等场景. 触发器基本操作 1. 创建触发器 ...

  6. Docker Compose集成式应用组合及service编排

    Compose简介 Compose项目是Docker官方的开源项目,负责实现对Docker容器集群的快速编排.其代码目前在 https://github.com/docker/compose 开源.C ...

  7. react-native Android release打包失败

    npm run build报错(android) react-native 0.5x在安卓环境 gradle 3.x版本下编译release版本的时候提示编译失败,但是debug模式下是没有问题的. ...

  8. ACM-ICPC 2018 焦作赛区网络预赛 I题 Save the Room

    Bob is a sorcerer. He lives in a cuboid room which has a length of AA, a width of BB and a height of ...

  9. CodeForces1006C-Three Parts of the Array

    C. Three Parts of the Array time limit per test 1 second memory limit per test 256 megabytes input s ...

  10. Golang 在电商即时通讯服务建设中的实践

    马蜂窝技术原创文章,更多干货请搜索公众号:mfwtech ​即时通讯(IM)功能对于电商平台来说非常重要,特别是旅游电商. 从商品复杂性来看,一个旅游商品可能会包括用户在未来一段时间的衣.食.住.行等 ...