diff --git a/lib/cyclic-hash/decr b/lib/cyclic-hash/decr new file mode 100755 index 0000000..3c59d82 --- /dev/null +++ b/lib/cyclic-hash/decr @@ -0,0 +1,73 @@ +#!/usr/bin/php + 1 ){ + + /* (1) Decrement the depth */ + $depth--; + + /* (2) Try to override the secret file */ + @file_put_contents(SECRET_FILE, "$key:$depth") && die(0) || die(127); + + + /* [4] If cannot decrement, generate new password + =========================================================*/ + }else{ + + // Generate new secret + $secret = generate_secret().':1000'; + + // Try to override the secret file + file_put_contents(SECRET_FILE, $secret) && die(0) || die(127); + + } + + +?> diff --git a/lib/cyclic-hash/hash b/lib/cyclic-hash/hash new file mode 100755 index 0000000..15f934d --- /dev/null +++ b/lib/cyclic-hash/hash @@ -0,0 +1,33 @@ +#!/usr/bin/php +