-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monitor no-key service key rotation #315
Comments
https://www.php.net/manual/en/function.hash-algos.php print_r(hash_algos()); Output:
|
https://www.php.net/manual/en/function.hash.php echo hash('sha512', '');
echo -n | sha512sum
|
date(DATE_ATOM) We need millisecond precision, as 2 keys may be tested in a second. The Stack Overflow answer 11424665 helps. //use \Datetime;
$now = new DateTime();
echo $now->getTimestamp();
die(); |
If the key is removed, then its hash does not make me able to get the initial YouTube Data API v3 key. |
function logg($filePath, $toWrite) {
$toWrite = floor(microtime(true) * 1000) . ' ' . $toWrite;
file_put_contents($filePath, $toWrite . "\n", FILE_APPEND);
}
logg('no_key_logs.txt', hash('sha512', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' . $key));
logg('../no_key_logs_secret.txt', "New key $key"); http://yt.lemnoslife.com/no_key_logs.txt
However, making people able to distinguish a key from another can interesting. |
Note that an interesting metric is how many days it takes to loop on an already used key. Having some anonymized logs to let people see people's usage and involved quota usage. However, have to ensure that requests do not leak any private information by specifying the shape of correct requests. If consider URLs it is not too much complicated to list all YouTube Data API v3 and YouTube operational API web-scraping endpoints, however for parameters it starts being annonying except if automatize. |
It seems that the mutex is not actually exclusive. cut -d ' ' -f 2 no_key_logs.txt | uniq | wc -l helps. |
https://discord.com/channels/933841502155706418/933841503103627316/1290273845143404565
The text was updated successfully, but these errors were encountered: