Passcode derivation

A common security method used for online banking is to ask the user for three random characters from a passcode. For example, if the passcode was 531278, they may ask for the 2nd, 3rd, and 5th characters; the expected reply would be: 317.

The text file, keylog.txt, contains fifty successful login attempts.

Given that the three characters are always asked for in order, analyse the file so as to determine the shortest possible secret passcode of unknown length.


密码推断

网上银行常用的一种密保手段是向用户询问密码中的随机三位字符。例如,如果密码是531278,询问第2、3、5位字符,正确的回复应当是317。

在文本文件keylog.txt中包含了50次成功登陆的正确回复。

假设三个字符总是按顺序询问的,分析这个文本文件,给出这个未知长度的密码最短的一种可能。

思路:

法一:

肉眼看了下:73162890,正确!!! OK

法二:

参考法一

Project Euler 79:Passcode derivation的更多相关文章

  1. Python练习题 039:Project Euler 011:网格中4个数字的最大乘积

    本题来自 Project Euler 第11题:https://projecteuler.net/problem=11 # Project Euler: Problem 10: Largest pro ...

  2. Python练习题 049:Project Euler 022:姓名分值

    本题来自 Project Euler 第22题:https://projecteuler.net/problem=22 ''' Project Euler: Problem 22: Names sco ...

  3. Python练习题 048:Project Euler 021:10000以内所有亲和数之和

    本题来自 Project Euler 第21题:https://projecteuler.net/problem=21 ''' Project Euler: Problem 21: Amicable ...

  4. Python练习题 047:Project Euler 020:阶乘结果各数字之和

    本题来自 Project Euler 第20题:https://projecteuler.net/problem=20 ''' Project Euler: Problem 20: Factorial ...

  5. Python练习题 046:Project Euler 019:每月1日是星期天

    本题来自 Project Euler 第19题:https://projecteuler.net/problem=19 ''' How many Sundays fell on the first o ...

  6. Python练习题 045:Project Euler 017:数字英文表达的字符数累加

    本题来自 Project Euler 第17题:https://projecteuler.net/problem=17 ''' Project Euler 17: Number letter coun ...

  7. Python练习题 044:Project Euler 016:乘方结果各个数值之和

    本题来自 Project Euler 第16题:https://projecteuler.net/problem=16 ''' Project Euler 16: Power digit sum 2* ...

  8. Python练习题 043:Project Euler 015:方格路径

    本题来自 Project Euler 第15题:https://projecteuler.net/problem=15 ''' Project Euler: Problem 15: Lattice p ...

  9. Python练习题 042:Project Euler 014:最长的考拉兹序列

    本题来自 Project Euler 第14题:https://projecteuler.net/problem=14 ''' Project Euler: Problem 14: Longest C ...

随机推荐

  1. vim 安装与运行以及代码的运行

    vi功能是最弱的,也是*nix操蛋之后最基本的editor.后来vi被增强加入众多特性,这就是vim.再后来vim加入图形接口,gvim诞生了.功能最强的是gvim,它的很多特性vim并不支持,vi更 ...

  2. 锋利的jquery-选择器

    1 jquery $(document).ready(function(){}) 可以简写成 $(function(){})   2 jquery 对象和DOM对像 ① jquery对象和DOM对象不 ...

  3. 【Qt】Qt Creator快捷键【转】

    简介 Qt Creator中提供了各种快捷键来加快开发进程. 如果需要查看或自定义快捷键,选择工具->选项->环境->键盘.快捷键按类别列出,可以在过滤器(Filter)处输入命令名 ...

  4. Scrapy源码学习(一)

    用Scrapy已经有一段时间了,觉得该是看一下源码的时候了.最开始用的时候还是0.16的版本,现在稳定版已经到了0.18.结合使用Scrapy的过程,先从Scrapy的命令行看起. 一.准备 下载源代 ...

  5. mysql主从备份、主从切换的例子

    指定binlog(因为时通过binlog实现数据同步的) 配置完后重启数据库服务,用show master status可以看到Master信息. StepB: 在SerB的my.cnf中指定 [ht ...

  6. CentOS安全设置

    删除多余的用户和用户组,修改口令文件属性,禁止[Ctrl+Alt+Delete]重启命令,防止别人ping的方法.整理自互联网. 1.删除多余的用户和用户组 //删除多余用户 # vi /etc/pa ...

  7. 给view 添加事件

    //绑定图片点击事件 UITapGestureRecognizer *g=[[UITapGestureRecognizeralloc]initWithTarget:selfaction:@select ...

  8. SQL Server Management Studio Keyboard shortcuts

    一些平时在SQL Server Management Studio 使用到的快捷键 F5 (Ctrl+x)执行选中部分的语句,没有选中则全文执行 Ctrl+L 现实执行计划(估计) Ctrl+M 在运 ...

  9. Ubuntu首次开启root用户

    最近一直在学习linux,选择ubuntu作为联系的操作系统.然后一直发现自己所创建的用户和root用户不是一个概念,执行好多命令的时候都提示没有权限.这样,最后终于发现原来是ubuntu是默认关闭r ...

  10. android开发 PopupWindow 设置充满屏幕

    View qrcode_view = this.getLayoutInflater().inflate(R.layout.taskdetail_qrcode,null); final PopupWin ...