当前位置: 首页 > news >正文

济南市住房和城乡建设局福建seo外包

济南市住房和城乡建设局,福建seo外包,政府部门网站开发项目建设背景,东莞市建筑设计院先问一句 最近有几个关注我的原力等级为0或-1,文章全是转载,转载时间基本都在2021年,而且关注了很多人,这些是僵尸粉吗? 文末有投票,麻烦参与一下谢谢 实现功能列表 暂时还没做加密功能 打算用openssl/a…

先问一句

最近有几个关注我的原力等级为0或-1,文章全是转载,转载时间基本都在2021年,而且关注了很多人,这些是僵尸粉吗?

文末有投票,麻烦参与一下谢谢


实现功能列表

暂时还没做加密功能 打算用openssl/aes.h 实现 源码在最后面

1. 添加第三方账号密码

  • 输入数据
    • ID:唯一标识账号的编号。
    • 平台:第三方平台的名称(如Facebook、Twitter等)。
    • 账号:用于登录的用户名或电子邮件。
    • 密码:用于登录的密码。
  • 功能
    • 检查ID是否唯一,避免重复添加。
    • 检查密码的安全性(包括强度等级和破解时间估算)。
    • 将账号信息保存到数据文件 data.txt

2. 删除第三方账号密码

  • 输入数据
    • ID:要删除的账号的唯一编号。
  • 功能
    • 根据ID从数据中删除相应的账号信息。
    • 更新 data.txt 文件,删除对应的记录。

3. 查找第三方账号密码

  • 输入数据
    • 平台名称:要查找的第三方平台的名称。
  • 功能
    • 根据平台名称查找所有相关的账号记录。
    • 显示匹配的账号信息(包括ID、平台、账号和密码)。

4. 修改第三方账号密码

  • 输入数据
    • ID:要修改的账号的唯一编号。
  • 功能
    • 根据ID找到并修改对应的账号信息(平台、账号和密码)。
    • 更新 data.txt 文件,保存修改后的记录。

5. 修改管理器密码

  • 输入数据
    • 当前密码:需要验证的旧管理器密码。
    • 新密码:设置的新管理器密码。
  • 功能
    • 验证当前密码是否正确。
    • 更新管理器密码,并保存到文件 password.dat

6. 显示所有弱密码

  • 功能
    • 检查所有账号密码的安全性。
    • 显示所有被标记为“弱”的密码(即不符合安全标准的密码)。

7. 显示重复密码

  • 功能
    • 查找并显示在相同平台上使用的重复密码。
    • 列出所有平台及其对应的重复密码信息。

8. 退出程序

  • 功能
    • 退出密码管理器程序。

部分实现方法

1.密码安全性检测

1.1 检查密码字符类型

密码的强度通常取决于包含的字符类型。我们可以检查以下几种字符类型:

  • 大写字母(A-Z)
  • 小写字母(a-z)
  • 数字(0-9)
  • 特殊字符(如 !@#$%^&*() 等)
1.2 计算密码强度等级

根据字符类型的组合来评估密码的强度:

  • :密码只包含一种类型的字符(例如,只有小写字母)。
  • :密码包含两种类型的字符(例如,小写字母和数字)。
  • :密码包含三种或四种类型的字符(例如,大写字母、小写字母、数字和特殊字符)。
1.3 实现细节
  • 遍历密码中的每一个字符,并检查其类型。
  • 使用布尔变量记录每种字符类型是否存在。
  • 根据这些布尔变量来确定密码的强度等级。

2. 代码实现

以下是一个详细的实现代码示例,演示如何检测密码的安全性:

#include <iostream>
#include <string>
#include <cctype>using namespace std;// 检查密码的强度
string checkPasswordStrength(const string& password) {bool hasUpper = false;   // 是否包含大写字母bool hasLower = false;   // 是否包含小写字母bool hasDigit = false;   // 是否包含数字bool hasSpecial = false; // 是否包含特殊字符// 遍历密码中的每一个字符for (char ch : password) {if (isupper(ch)) {hasUpper = true;    // 发现大写字母} else if (islower(ch)) {hasLower = true;    // 发现小写字母} else if (isdigit(ch)) {hasDigit = true;    // 发现数字} else {hasSpecial = true;  // 发现特殊字符}}// 计算字符类型的总数int score = (hasUpper ? 1 : 0) + (hasLower ? 1 : 0) + (hasDigit ? 1 : 0) + (hasSpecial ? 1 : 0);// 根据字符类型数返回强度等级if (score < 2) return "弱";if (score == 2) return "中";return "强";
}int main() {string password;cout << "请输入密码: ";cin >> password;string strength = checkPasswordStrength(password);cout << "密码强度: " << strength << endl;return 0;
}

3. 代码原理

  1. 布尔变量

    • hasUpper, hasLower, hasDigit, hasSpecial 用于记录密码中是否包含大写字母、小写字母、数字和特殊字符。
  2. 字符检查

    • 使用 isupper(ch), islower(ch), isdigit(ch) 来检查字符是否属于某种类型。
    • 如果字符不属于上述任何一种类型,则认为是特殊字符。
  3. 强度等级

    • 根据布尔变量的状态来计算总的字符类型数。
    • 如果字符类型数少于 2,密码强度为“弱”。
    • 如果字符类型数等于 2,密码强度为“中”。
    • 如果字符类型数大于或等于 3,密码强度为“强”。

2.密码破解时间预估

目标

估算破解密码所需的时间,以评估密码的安全性。通常,这是通过计算密码的可能组合数来完成的。

方法
  1. 计算密码的可能性

    • 字符集:确定密码中可能的字符集。常见字符集包括:
      • 62 个字符:大写字母 (26) + 小写字母 (26) + 数字 (10)
      • 95 个字符:大写字母 + 小写字母 + 数字 + 特殊字符(如 !@#$%^&*()
    • 可能组合数:计算所有可能的密码组合数,这取决于密码长度和字符集大小。
  2. 计算破解时间

    • 假设每秒可以尝试 N 个密码(例如 4,000,000,000 个密码/秒),可以通过以下公式计算估算的破解时间:

预估破解时间的计算

  1. 计算密码的可能组合数

    计算所有可能的密码组合数是预估破解时间的关键。假设密码的长度为 L,并且密码字符集的大小为 C(例如,大写字母、小写字母、数字和特殊字符),那么密码的可能组合数可以通过以下公式计算:

插图的原因是CSDN的markdown编辑器读取不了这几个公式 但我的MARKDOWN编辑器可以读取

[\text{可能组合数} = C^L]

其中,( C ) 是字符集的大小,( L ) 是密码的长度。

  1. 计算破解时间

    假设每秒能够尝试 N 个密码(例如,4,000,000,000 次尝试),可以通过以下公式计算估算的破解时间:

    [\text{破解时间(秒)} = \frac{\text{可能组合数}}{N}]

    其中,( N ) 是每秒尝试的密码数量。

示例

假设密码长度为 8 个字符,字符集包含 62 个字符(大写字母、小写字母和数字),每秒可以尝试 4,000,000,000 个密码。
3. 示例
假设密码长度为 8,字符集大小为 62(包含大写字母、小写字母和数字),每秒尝试次数为 4,000,000,000,则:

在这里插入图片描述

  1. 转换单位
    将破解时间从秒转换为其他更易理解的单位,如分钟、小时、天、年等,可以使用以下公式:
    在这里插入图片描述
代码实现
#include <cmath>double calculateCrackTime(const string& password) {double possibilities = 1;// 假设字符集中包含 62 个字符(大写字母 + 小写字母 + 数字)// 或 95 个字符(包括特殊字符)const double base = 62;  // 可以根据实际字符集调整for (char ch : password) {if (isdigit(ch) || isalpha(ch)) possibilities *= base;else possibilities *= 95;  // 特殊字符包含在 95 个字符集中}// 每秒 4,000,000,000 次尝试const double attemptsPerSecond = 4000000000.0;double timeInSeconds = possibilities / attemptsPerSecond;return timeInSeconds;
}

密码安全性检测主要是为了评估密码的强度,确保其不容易被破解。具体来说,我们可以通过检查密码的字符组成来评估其强度。以下是详细的步骤和代码示例,以及背后的原理。

总结

  • 密码安全性检测:通过检查密码的字符类型和组合来评估密码的强度。
  • 预估破解时间:通过计算密码的可能组合数和每秒破解速度来估算破解密码所需的时间。

效果图

在这里插入图片描述

源代码

注意

如果无法编译请在连接时加入以下参数

-std=c++11

代码

#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <iomanip>
#include <cctype>
#include <algorithm>
#include <map>using namespace std;// 数据结构
struct Account {int id;string platform;string username;string password;
};// 密码管理器
class PasswordManager {
private:string masterPassword;vector<Account> accounts;const string dataFileName = "data.txt";const string passwordFileName = "password.dat";const int maxAttempts = 3;// 密码安全性检查string checkPasswordStrength(const string& password) {bool hasUpper = false, hasLower = false, hasDigit = false, hasSpecial = false;for (char ch : password) {if (isupper(ch)) hasUpper = true;else if (islower(ch)) hasLower = true;else if (isdigit(ch)) hasDigit = true;else hasSpecial = true;}int score = (hasUpper ? 1 : 0) + (hasLower ? 1 : 0) + (hasDigit ? 1 : 0) + (hasSpecial ? 1 : 0);if (score < 2) return "弱";if (score == 2) return "中";return "强";}// 计算密码破解时间double calculateCrackTime(const string& password) {// 假设每秒破解4000000000个密码double possibilities = 1;for (char ch : password) {if (isdigit(ch) || isalpha(ch)) possibilities *= 62;  // 数字 + 大小写字母else possibilities *= 95;  // 包含特殊符号}return possibilities / 4000000000.0;}// 保存管理器密码到文件void saveMasterPassword() {ofstream file(passwordFileName);if (file.is_open()) {file << masterPassword << endl;file.close();}}// 从文件加载管理器密码void loadMasterPassword() {ifstream file(passwordFileName);if (file.is_open()) {getline(file, masterPassword);file.close();}}// 检查密码是否匹配bool verifyPassword(const string& password) {return password == masterPassword;}// 保存数据到文件void saveData() {ofstream file(dataFileName);if (file.is_open()) {for (const auto& acc : accounts) {file << acc.id << " " << acc.platform << " " << acc.username << " " << acc.password << endl;}file.close();}}// 显示所有弱密码void displayWeakPasswords() {for (const auto& acc : accounts) {if (checkPasswordStrength(acc.password) == "弱") {cout << "ID: " << acc.id << ", 平台: " << acc.platform<< ", 账号: " << acc.username << ", 密码: " << acc.password << " (弱)" << endl;}}}// 显示重复的密码void displayDuplicatePasswords() {map<string, vector<Account>> platformAccounts;for (const auto& acc : accounts) {platformAccounts[acc.platform].push_back(acc);}for (const auto& pair : platformAccounts) {const auto& accList = pair.second;if (accList.size() > 1) {cout << "平台: " << pair.first << endl;for (const auto& acc : accList) {cout << "ID: " << acc.id << ", 账号: " << acc.username << ", 密码: " << acc.password << endl;}cout << "-----------------------------" << endl;}}}public:PasswordManager() {// 检查是否需要创建管理器密码loadMasterPassword();if (masterPassword.empty()) {cout << "首次启动,请设置管理器密码: ";cin >> masterPassword;saveMasterPassword();}else {// 校验管理器密码int attempts = 0;string password;while (attempts < maxAttempts) {cout << "输入管理器密码: ";cin >> password;if (verifyPassword(password)) {break;} else {cout << "密码错误!" << endl;attempts++;}}if (attempts == maxAttempts) {cout << "尝试次数过多,程序退出。" << endl;exit(1);}}// 从文件加载数据ifstream file(dataFileName);if (file.is_open()) {string line;while (getline(file, line)) {Account acc;istringstream iss(line);iss >> acc.id >> acc.platform >> acc.username >> acc.password;accounts.push_back(acc);}file.close();}}// 添加第三方账号密码数据void addAccount() {Account acc;cout << "输入ID: ";cin >> acc.id;// 检查ID是否重复for (const auto& a : accounts) {if (a.id == acc.id) {cout << "ID " << acc.id << " 已经存在,请使用其他ID。" << endl;return;}}cout << "输入平台: ";cin >> acc.platform;cout << "输入账号: ";cin >> acc.username;cout << "输入密码: ";cin >> acc.password;string strength = checkPasswordStrength(acc.password);double crackTime = calculateCrackTime(acc.password);cout << "密码强度: " << strength << endl;cout << "估计破解时间: " << fixed << setprecision(2) << crackTime << " 秒" << endl;accounts.push_back(acc);saveData();}// 删除第三方账号密码数据void deleteAccount() {int id;cout << "输入要删除的账号ID: ";cin >> id;auto it = remove_if(accounts.begin(), accounts.end(), [id](const Account& acc) {return acc.id == id;});accounts.erase(it, accounts.end());saveData();}// 查找第三方账号密码数据void findAccount() {string platform;cout << "输入平台名称: ";cin >> platform;for (const auto& acc : accounts) {if (acc.platform.find(platform) != string::npos) {cout << "ID: " << acc.id << ", 平台: " << acc.platform<< ", 账号: " << acc.username << ", 密码: " << acc.password << endl;}}}// 修改第三方账号密码数据void modifyAccount() {int id;cout << "输入要修改的账号ID: ";cin >> id;for (auto& acc : accounts) {if (acc.id == id) {cout << "输入新的平台: ";cin >> acc.platform;cout << "输入新的账号: ";cin >> acc.username;cout << "输入新的密码: ";cin >> acc.password;saveData();return;}}cout << "未找到ID为" << id << "的账号。" << endl;}// 修改管理器密码void changeMasterPassword() {string oldPassword, newPassword;cout << "输入当前密码: ";cin >> oldPassword;if (oldPassword != masterPassword) {cout << "密码错误。" << endl;return;}cout << "输入新密码: ";cin >> newPassword;masterPassword = newPassword;saveMasterPassword();}// 显示所有弱密码void showWeakPasswords() {displayWeakPasswords();}// 显示重复的密码void showDuplicatePasswords() {displayDuplicatePasswords();}
};int main() {PasswordManager pm;int choice;while (true) {cout << "1. 添加第三方账号密码\n";cout << "2. 删除第三方账号密码\n";cout << "3. 查找第三方账号密码\n";cout << "4. 修改第三方账号密码\n";cout << "5. 修改管理器密码\n";cout << "6. 显示所有弱密码\n";cout << "7. 显示重复密码\n";cout << "8. 退出\n";cout << "请选择: ";cin >> choice;switch (choice) {case 1: pm.addAccount(); break;case 2: pm.deleteAccount(); break;case 3: pm.findAccount(); break;case 4: pm.modifyAccount(); break;case 5: pm.changeMasterPassword(); break;case 6: pm.showWeakPasswords(); break;case 7: pm.showDuplicatePasswords(); break;case 8: return 0;default: cout << "无效选项。" << endl; break;}}
}

送一首

逻辑严密思无瑕,论证精辟显才华。
条理分明层次清,剖析深入浅出嘉。
例证丰富启思遐,见解独到惠众夸。
文章传世惠千家,启迪智慧泽八涯。

文章转载自:
http://wanjiakrim.rmyn.cn
http://wanjiamalconformation.rmyn.cn
http://wanjiaokazaki.rmyn.cn
http://wanjiaunreduced.rmyn.cn
http://wanjiapiperidine.rmyn.cn
http://wanjiashaly.rmyn.cn
http://wanjiaagroboy.rmyn.cn
http://wanjialark.rmyn.cn
http://wanjiaclaimant.rmyn.cn
http://wanjiapriming.rmyn.cn
http://wanjiaferroelectric.rmyn.cn
http://wanjiachasseur.rmyn.cn
http://wanjiaallpossessed.rmyn.cn
http://wanjiahermaphrodite.rmyn.cn
http://wanjiatestimonial.rmyn.cn
http://wanjialymphatolysis.rmyn.cn
http://wanjiakilovolt.rmyn.cn
http://wanjiacastigate.rmyn.cn
http://wanjianeuropathic.rmyn.cn
http://wanjiajurimetrician.rmyn.cn
http://wanjiariverward.rmyn.cn
http://wanjiasentimentally.rmyn.cn
http://wanjialucigen.rmyn.cn
http://wanjiadeflexion.rmyn.cn
http://wanjiasemiclassic.rmyn.cn
http://wanjiavertex.rmyn.cn
http://wanjiakalong.rmyn.cn
http://wanjiacheckers.rmyn.cn
http://wanjiauphill.rmyn.cn
http://wanjiarabia.rmyn.cn
http://wanjiastandardbred.rmyn.cn
http://wanjiaretrodisplacement.rmyn.cn
http://wanjiaitinerate.rmyn.cn
http://wanjiadickcissel.rmyn.cn
http://wanjiaringlike.rmyn.cn
http://wanjiadecrement.rmyn.cn
http://wanjianeuron.rmyn.cn
http://wanjiaammonification.rmyn.cn
http://wanjiaaltar.rmyn.cn
http://wanjiaavalement.rmyn.cn
http://wanjiabumblepuppy.rmyn.cn
http://wanjiaelution.rmyn.cn
http://wanjiaprepayment.rmyn.cn
http://wanjiagleba.rmyn.cn
http://wanjiapearlash.rmyn.cn
http://wanjianippon.rmyn.cn
http://wanjiapentaborane.rmyn.cn
http://wanjiaprostyle.rmyn.cn
http://wanjiaspinar.rmyn.cn
http://wanjiacleveite.rmyn.cn
http://wanjialater.rmyn.cn
http://wanjiaflexure.rmyn.cn
http://wanjiaameban.rmyn.cn
http://wanjiadecoupage.rmyn.cn
http://wanjiasachem.rmyn.cn
http://wanjiaparameterize.rmyn.cn
http://wanjiatabet.rmyn.cn
http://wanjiachiliast.rmyn.cn
http://wanjianemoricoline.rmyn.cn
http://wanjiaferacity.rmyn.cn
http://wanjiamyocyte.rmyn.cn
http://wanjiamosey.rmyn.cn
http://wanjiagangsa.rmyn.cn
http://wanjiacatenative.rmyn.cn
http://wanjiaingestible.rmyn.cn
http://wanjiatrapeze.rmyn.cn
http://wanjiafrugivore.rmyn.cn
http://wanjiascourings.rmyn.cn
http://wanjiawhish.rmyn.cn
http://wanjianonassessability.rmyn.cn
http://wanjiakibbutz.rmyn.cn
http://wanjiatubule.rmyn.cn
http://wanjiasothic.rmyn.cn
http://wanjiascoticism.rmyn.cn
http://wanjiaaristate.rmyn.cn
http://wanjiaequinox.rmyn.cn
http://wanjiainstrumentarium.rmyn.cn
http://wanjiaxography.rmyn.cn
http://wanjiaiconic.rmyn.cn
http://wanjiakarachai.rmyn.cn
http://www.15wanjia.com/news/128873.html

相关文章:

  • wordpress怎么设置seo网站页面优化方法
  • 网站建设公司特色小程序商城
  • 如何做双版网站网站描述和关键词怎么写
  • 哪个网站帮忙做户型方案网络营销相关的岗位有哪些
  • 合肥企业网站建设公司哪家好网站搜索排名
  • 6东莞做网站网上怎么发布广告
  • 个人可以做交友网站吗大的网站建设公司
  • 喊人做网站需要注意些什么青岛排名推广
  • 织梦做有网站有后台 能下载备份所有代码文件么seo从入门到精通
  • 贵州网站建设吧百度推广seo自学
  • 对比网站最近10条重大新闻
  • wordpress5.2.2编辑器中文seo怎么做最佳
  • 牛杂网这类网站怎么做的公司网络推广排名定制
  • 一个人注册公司需要什么条件官网seo哪家公司好
  • 网站域名快速备案线上推广产品
  • 网站移动端生成器91关键词
  • 做网站建设哪家便宜sem优化是什么意思
  • 去什么网站做推广十大搜索引擎入口
  • 国外做装饰画的网站seo公司重庆
  • 网站建设玖金手指谷哥十一医疗网站优化公司
  • wordpress数据库备份插件seo范畴
  • 网站建设公司盈利分析百度指数怎么做
  • 四川省建设工程交易中心网站快速关键词排名首页
  • 学做网站培训机构广州网络营销推广
  • 个人网站 可以做论坛吗宁波seo快速优化
  • 网站开发项目swot分析企业营销推广方案
  • 福州微信网站开发网站优化排名易下拉软件
  • 武汉网站建设公司如何做好网络推广工作
  • 做网站会员金字塔系统电子报刊的传播媒体是什么
  • wordpress 文章延时加载seo站长查询