首页 技术 正文
技术 2022年11月12日
0 收藏 445 点赞 2,779 浏览 3056 个字

UVa 1262  Password

题目:

Password 

Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu

Submit Status

Description

 Shoulder-surfing is the behavior of intentionally and stealthily watching the screen of another person’s electronic device, such as laptop computer or mobile phone. Since mobile devices prevail, it is getting serious to steal personal information by shoulder-surfing.

Suppose that we have a smart phone. If we touch the screen keyboard directly to enter the password, this is very vulnerable since a shoulder-surfer easily knows what we have typed. So it is desirable to conceal the input information to discourage shoulder-surfers around us. Let me explain one way to do this.

You are given a 6 x 5 grid. Each column can be considered the visible part of a wheel. So you can easily rotate each column wheel independently to make password characters visible. In this problem, we assume that each wheel contains the 26 upper letters of English alphabet. See the following Figure 1.

【暑假】[数学]UVa 1262 PasswordFigure 1. 6 x 5 window clips a valid grid representation for a password.

Assume that we have a length-5 password such as p1 p2 p3 p4 p5. In order to pass the authentication procedure, we should construct a configuration of grid space where each pi appears in the i-th column of the grid. In that situation we say that the user password is accepted.

Let me start with one example. Suppose that our password was set `COMPU’. If we construct the grid as shown in Figure 2 on next page, then the authentication is successfully processed.

【暑假】[数学]UVa 1262 PasswordFigure 2. A valid grid representation for password `COMPU’.

In this password system, the position of each password character in each column is meaningless. If each of the 5 characters in p1 p2 p3 p4 p5 appears in the corresponding column, that can be considered the correct password. So there are many grid configurations allowing one password. Note that the sequence of letters on each wheel is randomly determined for each trial and for each column. In practice, the user is able to rotate each column and press “Enter” key, so a should-surfer cannot perceive the password by observing the 6 x 5 grid since there are too many password candidates. In this 6 x 5 grid space, maximally 65 = 7, 776 cases are possible. This is the basic idea of the proposed password system against shoulder-surfers.

Unfortunately there is a problem. If a shoulder-surfer can observe more than two grid plate configurations for a person, then the shoulder-surfer can reduce the searching space and guess the correct password. Even though it is not easy to stealthily observe other’s more than once, this is one weakness of implicit grid passwords.

Let me show one example with two observed configurations for a grid password. The user password is `COMPU’, but `DPMAG’ is also one candidate password derived from the following configuration.

【暑假】[数学]UVa 1262 PasswordFigure 3. Both of `COMPU’ and `DPMAG’ are feasible password .

You are given two configurations of grid password from a shoulder-surfer. Suppose that you have succeeded to stealthily record snapshots of the target person’s device (e.g. smart phone). Then your next task is to reconstruct all possible passwords from these two snapshots. Since there are lots of password candidates, you are asked for the k-th password among all candidates in lexicographical order. In Figure 3, let us show the first 5 valid password. The first 5 valid passwords are `ABGAG’ , `ABGAS’, `ABGAU’, `ABGPG’ and `ABGPS’.

The number k is given in each test case differently. If there does not exist a k-th password since k is larger than the number of all possible passwords, then you should print `NO‘ in the output.

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,105
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,582
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,429
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,200
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,836
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,919