mirror of
https://github.com/cubixle/codekata-golang.git
synced 2026-04-24 23:04:42 +01:00
79: Passcode derivation
This commit is contained in:
11
79_passcode_derivation/main.go
Normal file
11
79_passcode_derivation/main.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
//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.
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
}
|
||||||
50
79_passcode_derivation/p079_keylog.txt
Normal file
50
79_passcode_derivation/p079_keylog.txt
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
319
|
||||||
|
680
|
||||||
|
180
|
||||||
|
690
|
||||||
|
129
|
||||||
|
620
|
||||||
|
762
|
||||||
|
689
|
||||||
|
762
|
||||||
|
318
|
||||||
|
368
|
||||||
|
710
|
||||||
|
720
|
||||||
|
710
|
||||||
|
629
|
||||||
|
168
|
||||||
|
160
|
||||||
|
689
|
||||||
|
716
|
||||||
|
731
|
||||||
|
736
|
||||||
|
729
|
||||||
|
316
|
||||||
|
729
|
||||||
|
729
|
||||||
|
710
|
||||||
|
769
|
||||||
|
290
|
||||||
|
719
|
||||||
|
680
|
||||||
|
318
|
||||||
|
389
|
||||||
|
162
|
||||||
|
289
|
||||||
|
162
|
||||||
|
718
|
||||||
|
729
|
||||||
|
319
|
||||||
|
790
|
||||||
|
680
|
||||||
|
890
|
||||||
|
362
|
||||||
|
319
|
||||||
|
760
|
||||||
|
316
|
||||||
|
729
|
||||||
|
380
|
||||||
|
319
|
||||||
|
728
|
||||||
|
716
|
||||||
Reference in New Issue
Block a user