綁定帳號登入

Android 台灣中文網

打印 上一主題 下一主題

[其他] 【25/01/12】離線密碼產生器 (離線+完全開源+免費)

[複製連結] 查看: 1293|回覆: 5|好評: 0
跳轉到指定樓層
樓主
love_apktw | 收聽TA | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
發表於 2025-1-12 17:30

馬上加入Android 台灣中文網,立即免費下載應用遊戲。

您需要 登錄 才可以下載或查看,沒有帳號?註冊

x
軟體名稱】:密碼產生器
【軟體版本】:v1 (可能會增加新功能)
【版本類型】:離線、完全開源、免費版
【軟體語言】:繁體中文
【檔案大小】:9KB
【作業系統】:Windows (其他系統未測試)
——————————————————————————————————————————
【軟體介紹】:
此程式無需網路也可生成密碼,而且可高度自訂,保證您的密碼與別人的不一樣,
搭配瀏覽器的"密碼管理工具"效果更佳!
——————————————————————————————————————————
【軟體原始碼】:
  1. <!DOCTYPE html>
  2. <html lang="zh-Hant">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>密碼產生器</title>
  7.     <style>
  8.         body {
  9.             font-family: sans-serif;
  10.             margin: 20px;
  11.         }
  12.         .container {
  13.             border: 1px solid #ccc;
  14.             padding: 20px;
  15.             border-radius: 5px;
  16.             display: grid;
  17.             grid-template-columns: 1fr 1fr;
  18.             gap: 20px;
  19.         }
  20.         .section {
  21.             margin-bottom: 15px;
  22.         }
  23.         .section:last-child {
  24.             grid-column: 1 / span 2;
  25.         }
  26.          .section h2 {
  27.              font-size: 1.2em;
  28.             margin-bottom: 10px;
  29.         }
  30.          .section label {
  31.              margin-right: 10px;
  32.         }
  33.           .section input[type="checkbox"]{
  34.                margin-right: 5px;
  35.         }
  36.         .section input[type="text"] {
  37.             padding: 8px;
  38.             border: 1px solid #ccc;
  39.             border-radius: 4px;
  40.             width: 95%;
  41.         }
  42.         .section input[type="number"]{
  43.             padding: 8px;
  44.             border: 1px solid #ccc;
  45.             border-radius: 4px;
  46.             width: 50px;
  47.         }
  48.          .section button {
  49.               padding: 10px 15px;
  50.              background-color: #4CAF50;
  51.              color: white;
  52.             border: none;
  53.               border-radius: 4px;
  54.              cursor: pointer;
  55.               transition: background-color 0.3s ease;
  56.          }
  57.           .section button:hover{
  58.             background-color: #45a049;
  59.          }
  60.          #password-result {
  61.               width: 100%;
  62.              height: 100px;
  63.                border: 1px solid #ccc;
  64.              border-radius: 4px;
  65.              padding: 8px;
  66.         }
  67.         #password-strength{
  68.           display: inline-block;
  69.              margin-left: 10px;
  70.          }
  71.          .strength-indicator {
  72.                 display: inline-block;
  73.                 width: 10px;
  74.                 height: 10px;
  75.                 border-radius: 50%;
  76.                 margin-left: 5px;
  77.          }
  78.        .strength-indicator.weak{
  79.                 background-color: red;
  80.         }
  81.       .strength-indicator.medium{
  82.                 background-color: orange;
  83.         }
  84.         .strength-indicator.strong {
  85.             background-color: green;
  86.         }

  87.         .copy-button {
  88.            padding: 5px 10px;
  89.            background-color: #3498db;
  90.             color: white;
  91.             border: none;
  92.               border-radius: 4px;
  93.            cursor: pointer;
  94.              margin-left: 10px;
  95.               transition: background-color 0.3s ease;
  96.         }
  97.         .copy-button:hover {
  98.              background-color: #2980b9;
  99.         }
  100.     </style>
  101. </head>
  102. <body>
  103.     <div class="container">
  104.          <div class="section">
  105.              <h2>備選字元:</h2>
  106.               <label><input type="checkbox" id="include-numbers" checked>0-9:</label>
  107.              <label><input type="checkbox" id="include-lowercase" checked>az:</label>
  108.              <label><input type="checkbox" id="include-uppercase" checked>AZ:</label>
  109.         </div>
  110.          <div class="section">
  111.               <h2>其它設定:</h2>
  112.             <label><input type="checkbox" id="unique-characters" checked>字元不重複:</label>
  113.         </div>
  114.         <div class="section">
  115.             <h2>其它備選字元:</h2>
  116.            <input type="text" id="other-characters" value="!@#$%^&*_-">
  117.         </div>
  118.         <div class="section">
  119.               <h2>排除字元:</h2>
  120.             <input type="text" id="exclude-characters" placeholder="不參與生成的字符">
  121.          </div>
  122.        <div class="section">
  123.             <h2>密碼長度</h2>
  124.               <input type="number" id="password-length" value="16" min="1" max="100">
  125.         </div>
  126.         <div class="section">
  127.             <h2>產生組數</h2>
  128.               <input type="number" id="group-count" value="1" min="1" max="10">
  129.          </div>
  130.        <div class="section">
  131.             <button onclick="generatePassword()">重新生成</button>
  132.             <span id="password-strength">密碼強度評估: 比較安全</span>
  133.             <span class="strength-indicator strong"></span>
  134.             <button class="copy-button" onclick="copyPassword()">複製密碼</button>

  135.         </div>
  136.       <div class="section">
  137.              <h2>隨機密碼已產生:</h2>
  138.             <textarea id="password-result" readonly></textarea>
  139.         </div>
  140.     </div>
  141.    <script>
  142.         function generatePassword() {
  143.             const includeNumbers = document.getElementById('include-numbers').checked;
  144.             const includeLowercase = document.getElementById('include-lowercase').checked;
  145.             const includeUppercase = document.getElementById('include-uppercase').checked;
  146.             const uniqueCharacters = document.getElementById('unique-characters').checked;
  147.             const otherCharacters = document.getElementById('other-characters').value;
  148.             const excludeCharacters = document.getElementById('exclude-characters').value;
  149.             const passwordLength = parseInt(document.getElementById('password-length').value);
  150.             const groupCount = parseInt(document.getElementById('group-count').value);
  151.             const passwordResult = document.getElementById('password-result');
  152.              const passwordStrength = document.getElementById('password-strength');
  153.             const strengthIndicator = document.querySelector('.strength-indicator');


  154.             let charPool = "";

  155.             if (includeNumbers) charPool += "0123456789";
  156.              if (includeLowercase) charPool += "abcdefghijklmnopqrstuvwxyz";
  157.             if (includeUppercase) charPool += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  158.             charPool += otherCharacters;


  159.             let result = "";
  160.              if (charPool.length === 0) {
  161.                 passwordResult.value = "請至少選擇一種類型的字元";
  162.                   passwordStrength.textContent = "密碼強度評估: 無法評估";
  163.                 strengthIndicator.className = "strength-indicator";
  164.               return;
  165.             }
  166.               let filteredCharPool = "";

  167.                for (let char of charPool) {
  168.                    if (!excludeCharacters.includes(char)) {
  169.                        filteredCharPool += char;
  170.                    }
  171.                }
  172.            if(filteredCharPool.length === 0){
  173.                   passwordResult.value = "排除字元已包含所有字元";
  174.                    passwordStrength.textContent = "密碼強度評估: 無法評估";
  175.                    strengthIndicator.className = "strength-indicator";
  176.                return;
  177.             }


  178.              for (let j = 0; j < groupCount; j++) {
  179.                  let password = "";
  180.                  let tempCharPool = filteredCharPool;
  181.                 for (let i = 0; i < passwordLength; i++) {
  182.                      const randomIndex = Math.floor(Math.random() * tempCharPool.length);
  183.                     password += tempCharPool[randomIndex];
  184.                       if(uniqueCharacters){
  185.                            tempCharPool = tempCharPool.substring(0, randomIndex) + tempCharPool.substring(randomIndex+1);
  186.                     }
  187.                  }
  188.                result += password + (j < groupCount - 1 ? "\n" : "");
  189.             }
  190.             passwordResult.value = result;

  191.              let strength = "強";
  192.                let indicatorClass = 'strong';
  193.                 if (passwordLength < 8) {
  194.                     strength = "弱";
  195.                     indicatorClass = 'weak';
  196.                 } else if (passwordLength < 12) {
  197.                     strength = "普通";
  198.                     indicatorClass = 'medium';
  199.                 }else if(filteredCharPool.length === 1){
  200.                      strength = "弱";
  201.                      indicatorClass = 'weak';
  202.                  }

  203.                 passwordStrength.textContent = "密碼強度評估: " + strength;
  204.                 strengthIndicator.className = `strength-indicator ${indicatorClass}`;
  205.         }


  206.           function copyPassword() {
  207.             const passwordResult = document.getElementById('password-result');
  208.              navigator.clipboard.writeText(passwordResult.value)
  209.                 .then(() => alert("密碼已複製到剪貼簿!"))
  210.                 .catch(err => console.error('無法複製密碼: ', err));
  211.         }
  212.     </script>

  213. </body>
  214. </html>
複製代碼

——————————————————————————————————————————
【軟體截圖】:
「用Android 就來APK.TW」,快來加入粉絲吧!
Android 台灣中文網(APK.TW)

評分

參與人數 16碎鑽 +17 經驗 +3 幫助 +17 收起 理由
stu80090 + 1 + 1 + 1 鼓勵一下!
xDo + 1 + 1 + 1 讚一個!
yo1180 + 2 + 1 + 2 讚一個!
sitirour + 1 + 1 非常讃
peter3426a + 1 + 1 非常讃
billowboys + 1 + 1 非常讃
cake1225 + 1 + 1 非常讃
綜合維他命 + 1 + 1 非常讃
a10010786 + 1 + 1 非常讃
happymofa + 1 非常讃

查看全部評分

收藏收藏6 分享分享 分享專題
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

沙發
thxyu | 收聽TA | 只看該作者
發表於 2025-1-12 19:19
簡單實用,下載備用,感謝分享!

評分

參與人數 3碎鑽 +3 幫助 +3 收起 理由
xDo + 1 + 1 非常讃
love_apktw + 1 + 1 非常讃
綜合維他命 + 1 + 1 非常讃

查看全部評分

用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

板凳
otter168 | 收聽TA | 只看該作者
發表於 2025-1-13 16:17
哇 ~ 有趣的東西
感謝分享

評分

參與人數 3碎鑽 +3 幫助 +3 收起 理由
xDo + 1 + 1 非常讃
love_apktw + 1 + 1 非常讃
綜合維他命 + 1 + 1 非常讃

查看全部評分

用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

地板
whowo | 收聽TA | 只看該作者
發表於 2025-1-14 23:24
看來簡單易用,來收藏備用,感謝分享

評分

參與人數 2碎鑽 +2 幫助 +2 收起 理由
xDo + 1 + 1 非常讃
love_apktw + 1 + 1 非常讃

查看全部評分

用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

5
stu80090 | 收聽TA | 只看該作者
發表於 2025-4-28 15:30
感謝提供簡易方便小工具
稍微改了一些自己方便的數值套用就不用再手動調整

評分

參與人數 1碎鑽 +1 幫助 +1 收起 理由
love_apktw + 1 + 1 非常讃

查看全部評分

用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

6
rt788 | 收聽TA | 只看該作者
發表於 2025-4-28 23:22
感覺還不錯,先謝過。

評分

參與人數 1碎鑽 +1 幫助 +1 收起 理由
love_apktw + 1 + 1 非常讃

查看全部評分

用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則