×

注意!页面内容来自https://www.jyshare.com/crypto/,本站不储存任何内容,为了更好的阅读体验进行在线解析,若有广告出现,请及时反馈。若您觉得侵犯了您的利益,请通知我们进行删除,然后访问 原网页

<> .navbar-nav .nav-item { white-space: nowrap; /* 防止li内部换行 */ } .navbar-nav .nav-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; /* 防止链接文字换行 */ } .navbar,.page-footer { background: rgb(7581104); border-width: 0px 0px 3px; border-bottom: 3px solid transparent; border-image: linear-gradient(90degrgb(14166108) 16%rgb(81153211) 16%rgb(81153211) 32%rgb(34201148) 32%rgb(34201148) 48%rgb(24019818)48%rgb(24019818)64%rgb(25517177) 64%rgb(25517177) 82%rgb(2107093) 82%) 1 / 1 / 0 stretch; } .page-footer { border-top: 3px solid transparent; border-width: 3px 0px 0px; } <> /* ══════════════════════════════════════════ 加密工具专用样式 ══════════════════════════════════════════ */ .runoob-page-content { margin: 20px; } /* ── 算法标签 ── */ .algorithm-badge { font-size: 12px; padding: 4px 9px; margin-left: 8px; vertical-align: middle; } /* ── 高级选项区 ── */ .advanced-options { background: #f8f9fa; border: 1px solid #e9ecef; padding: 14px 16px; border-radius: 6px; margin-bottom: 14px; } .advanced-options h6 { font-size: 13px; color: #495057; } /* ── 结果展示区 ── */ #hash_result { font-family: 'Courier New'Consolasmonospace; font-size: 16px; color: #212529; word-break: break-all; line-height: 1.7; min-height: 32px; white-space: pre-wrap; } #hash_result.placeholder-text { color: #adb5bd; font-: italic; font-size: 14px; } #hash_result.has-result { color: #155724; font-weight: bold; } #hash_result.has-error { color: #721c24; } /* 结果卡片 */ .result-card { transition: box-shadow .2s; } .result-card:hover { box-shadow: 0 .25rem .75rem rgba(0,0,0,.1) !important; } /* ── Toast 提示(替代 alert)── */ #crypto-toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; } .crypto-toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.15); pointer-events: auto; animation: toastIn .22s ease both; min-width: 220px; max-width: 360px; } .crypto-toast.toast-success { background: #66b779; } .crypto-toast.toast-error { background: #b85b64; } .crypto-toast.toast-info { background: #43b1c2; } @keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } } @keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } } /* ── 加载态 ── */ .btn-loading { pointer-events: none; opacity: .75; } .btn-loading .btn-text { display: none; } .btn-loading .btn-spinner { display: inline-block !important; } .btn-spinner { display: none; } /* ══ 工具列表:图标卡片网格 ══ */ /* 过滤 pills */ .crypto-filter-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; } .crypto-filter-label { font-size: 12px; font-weight: 700; color: #adb5bd; white-space: nowrap; margin-right: 2px; } .crypto-filter-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 980px; font-size: 12.5px; font-weight: 500; border: 1.5px solid #dee2e6; background: #fff; color: #6c757d; cursor: pointer; transition: all .15s; white-space: nowrap; line-height: 1; } .crypto-filter-btn:hover { border-color: #adb5bd; color: #343a40; } .crypto-filter-btn.active { background: var(--cat-color#007bff); border-color: var(--cat-color#007bff); color: #fff !important; box-shadow: 0 2px 8px rgba(0,0,0,.15); } .crypto-filter-btn .filter-count { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; background: rgba(255,255,255,.25); border-radius: 50%; font-size: 10px; font-weight: 700; line-height: 1; } .crypto-filter-btn:not(.active) .filter-count { background: #e9ecef; color: #6c757d; } /* 卡片网格 */ .crypto-grid { display: grid; grid-template-columns: repeat(auto-fillminmax(110px1fr)); gap: 10px; } /* 单个工具卡片 */ .crypto-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 8px 10px; border: 1.5px solid #e9ecef; border-radius: 10px; background: #fff; text-decoration: none; transition: all .18s; cursor: pointer; position: relative; overflow: hidden; } .crypto-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--cat-color#007bff); opacity: 0; transition: opacity .15s; } .crypto-card:hover { border-color: var(--cat-color#007bff); box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); text-decoration: none; } .crypto-card:hover::before { opacity: 1; } /* 当前工具高亮 */ .crypto-card.is-active { border-color: var(--cat-color#007bff); background: #f8f9ff; box-shadow: 0 2px 12px rgba(0,123,255,.15); } .crypto-card.is-active::before { opacity: 1; } .crypto-card.is-active .crypto-card-badge { display: flex; } .crypto-card-badge { display: none; position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; background: var(--cat-color#007bff); border-radius: 50%; align-items: center; justify-content: center; font-size: 7px; color: #fff; } /* 图标圆圈 */ .crypto-card-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--cat-bgrgba(0,123,255,.1)); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--cat-color#007bff); margin-bottom: 8px; transition: transform .18s; flex-shrink: 0; } .crypto-card:hover .crypto-card-icon { transform: scale(1.1); } .crypto-card-name { font-size: 12px; font-weight: 700; color: #343a40; line-height: 1.3; word-break: break-all; } .crypto-card-type { font-size: 10px; color: #adb5bd; margin-top: 2px; font-weight: 500; } /* 分组标题(网格内)*/ .crypto-grid-section { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 4px 0 2px; border-bottom: 1px solid #f0f0f0; margin-top: 6px; } .crypto-grid-section:first-child { margin-top: 0; } .crypto-grid-section-label { font-size: 11px; font-weight: 700; color: var(--cat-color#6c757d); letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; } .crypto-grid-section-line { flex: 1; height: 1px; background: #f0f0f0; } /* 隐藏动画 */ .crypto-card.hidden { display: none; } /* 空状态 */ .crypto-grid-empty { grid-column: 1/-1; text-align: center; color: #adb5bd; padding: 24px; font-size: 13px; } @media (max-width: 576px) { .crypto-grid { grid-template-columns: repeat(auto-fillminmax(90px1fr)); gap: 7px; } .crypto-card { padding: 10px 6px 8px; } .crypto-card-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 9px; } .crypto-card-name { font-size: 11px; } } /* 输入区面板标题 */ .panel-title { font-size: 15px; font-weight: 600; color: #6c757d; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid #dee2e6; }

SHA1 在线加密工具

哈希算法
输入要加密的数据
密钥
SHA-3 输出长度
RC4Drop 参数
丢弃初始密钥流,防止密钥流泄露
密钥派生参数
盐(salt)
迭代次数
高级加密选项
加密结果
等待输入…
加密工具列表
概述

SHA(Secure Hash Algorithm)是一组密码学哈希函数,用于将任意长度的数据转换成固定长度的哈希值。SHA算法广泛用于数据完整性验证、数字签名、密码学安全等领域。

SHA家族包括多个版本,其中较常见的有SHA-1、SHA-256、SHA-384和SHA-512等。

安全散列算法(英语:Secure Hash Algorithm,缩写为SHA)是一个密码散列函数家族,是 FIPS 所认证的安全散列算法。能计算出一个数字消息所对应到的,长度固定的字符串(又称消息摘要)的算法。且若输入的消息不同,它们对应到不同字符串的几率很高。

  • 哈希函数特性: SHA是一种单向散列函数,即对于给定的输入,可以迅速生成一个哈希值,但从哈希值反推出原始输入几乎是不可能的。这种性质对于密码学应用至关重要,因为它确保了哈希值的不可逆性。

  • SHA-1: SHA-1是最早的SHA版本,产生160位(20字节)的哈希值。然而,由于存在安全漏洞,SHA-1已经被认为是不安全的,不再推荐使用。

  • SHA-256、SHA-384、SHA-512: 这些版本产生更长的哈希值,分别是256位、384位和512位。这些版本提供更高的安全性,适用于不同的安全需求。例如,SHA-256通常用于数字签名和数据完整性验证。

  • 安全性: SHA算法的安全性建立在哈希碰撞的难解性基础上。哈希碰撞是指两个不同的输入产生相同的哈希值。在密码学中,算法被认为是安全的,如果找到碰撞的难度很大,使攻击者几乎不可能通过已知的方法找到两个不同的输入得到相同的哈希值。

  • 应用领域: SHA算法广泛应用于数字签名、证书生成、密码存储、数据完整性验证等领域。例如,在数字证书中,使用SHA算法生成证书的摘要,以确保证书的完整性和合法性。

SHA 家族的算法,由美国国家安全局(NSA)所设计,并由美国国家标准与技术研究院(NIST)发布,是美国的政府标准,其分别是:

  • SHA
      -0:1993年发布,当时称做安全散列标准(Secure Hash Standard),发布之后很快就被NSA撤回,是SHA-1的前身。
    • SHA-1:1995 年发布,SHA-1 在许多安全协议中广为使用,包括TLS、GnuPG、SSH、S/MIME和IPsec,是MD5的后继者。但SHA-1的安全性在2010年以后已经不被大多数的加密场景所接受。2017年荷兰密码学研究小组CWI和Google正式宣布攻破了SHA-1。
    • SHA-2:2001年发布,包括 SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224、SHA-512/256。SHA-2 目前没有出现明显的弱点。虽然至今尚未出现对 SHA-2 有效的攻击,但它的算法跟 SHA-1 基本上仍然相似。
    • SHA-3:2015 年正式发布,由于对 MD5 出现成功的破解,以及对 SHA-0 和 SHA-1 出现理论上破解的方法,NIST 感觉需要一个与之前算法不同的,可替换的加密散列算法,也就是现在的 SHA-3。
    算法名称摘要长度(位)输出长度(字节)安全性用途
    md512816不安全数据完整性验证、密码存储等
    sha116020不安全数据完整性验证、密码存储等
    sha22422428数据完整性验证、数字签名等
    sha25625632中等数据完整性验证、数字签名等
    sha38438448数字签名、加密算法等
    sha51251264数字签名、加密算法等
    sha3_22422428未来标准的 SHA-3 家族成员,适用于数字签名等
    sha3_25625632未来标准的 SHA-3 家族成员,适用于数字签名等
    sha3_38438448未来标准的 SHA-3 家族成员,适用于数字签名等
    sha3_51251264未来标准的 SHA-3 家族成员,适用于数字签名等
    shake_128可变可变SHAKE 系列是 SHA-3 家族的可变长度版本,适用于各种应用
    shake_256可变可变SHAKE 系列是 SHA-3 家族的可变长度版本,适用于各种应用

    SHA 函数对比

    下表中的中继散列值(internal state)表示对每个资料区块压缩散列过后的中继值(internal hash sum)。