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. 关于Protobuf在游戏开发中的运用

    最近在研究protobuf在项目中的使用,由于我们项目服务端采用的是C++,客户端是cocos2dx-cpp,客户端与服务端的消息传输是直接对象的二进制流.如果客户端一直用C++来写,问题到不大,但是 ...

  2. php数组声明、遍历、数组全局变量使用小结

    数组的本质:管理和操作一组变量,成批处理,下面为大家介绍下数组的分类.数组的分类及使用说明,感兴趣的朋友可以了解下哈   php教程:数组声明,遍历,数组全局变量  <? /* * 一.数组的概 ...

  3. php微信开发(1):缓存access_token的方法

    语言:PHP access_token一直要用,但每天取的数量有限制.反正2小时才过期.就想缓存一下. File1: wx_access_token.php File2: file_cache.php ...

  4. WCF全面解析第二章 地址(Adress)

    2.1 统一资源标识(URL) 2.1.1 Http/Https 2.1.2 Net.TCP 2.1.3 Net.Pipe WCF只将命名管道专门用于同一台机器的跨进程通信. 2.1.4 Net.Ms ...

  5. Response.Redirect和Server.Transfer

    今天又比较闲,逛了逛园子,看看asp.net的内容,看到一篇关于这两个的比较: http://www.cnblogs.com/yunfeng8967/archive/2008/03/06/109323 ...

  6. SQL中的自定义函数Function

    先给出一个链接吧,别人写的:http://www.cnblogs.com/diony/archive/2010/12/17/1909014.html 总结得很全面,感谢感谢!自己练习了一下后面的例子, ...

  7. 11g RAC R2 体系结构---进程,日志

    进程结构:Overview of Oracle Clusterware Platform-Specific Software Components When Oracle Clusterware is ...

  8. 12、在XAML中定义处理程序

    <Grid> <Button x:Name="btnTest" Width="120" Height="36" Conte ...

  9. Oralce常用维护命令

    1. sqlplus远程连接 方式一:简易连接,不用进行网络配置,其实就是tnsname.ora文件,但只支持oracle10G以上.命令:sqlplus 用户名/密码@ip地址[:端口]/servi ...

  10. [转]adb pull Permission denied及no such file错误

    adb pull  Permission denied及no such file错误 http://www.the8m.com/blog/article/javadk/adbpull.html XP系 ...