Google Authenticator

Վիքիպեդիայից՝ ազատ հանրագիտարանից
Google Authenticator
Изображение логотипа
Տեսակauthenticator?
ՀեղինակGoogle
Նախագծումը՝Գուգլ
ՕՀAndroid, iOS, BlackBerry OS
Լույս տեսավ՝2010-9-20 (13 տարի առաջ)[1]
Պլատֆորմբջջային
Արտոնագիրոչ ազատ ծրագրային ապահովման արտոնագիր[2]
Կայքgithub.com/google/google-authenticator-libpam
 Google Authenticator Վիքիպահեստում

Google Authenticator, Google-ի կողմից թողարկված երկփուլ աուտենտիֆիկացման հավելված, որը աշխատում է Time-based One-time Password Algorithm (TOTP) և HMAC-based One-time Password Algorithm (HOTP) ալգորիթմների շնորհիվ։ Ծառայությունը իրականացնում է [rfc:6238 RFC 6238-ում] և [rfc:4226 RFC 4226-ում] նշված ալգորիթմները[3]։

Authenticator-ը 6- կամ 8-նիշանի, միանգամյա օգտագործման համար նախատեսված թվային գաղտնաբառ է, որը օգտագերը պետք է ներկայացնի մասնակցային հաշվի և գաղտնաբառի հետ՝ Google-ի կամ այլ ծառայությունների ծառայությունները մուտք գործելու համար։ Authenticator նաև կարող է կոդ ստանալ կողմնակի հավելվածների համար, ինչպիսիք են, օրինակ, գաղտնաբառերի մենեջերները և ֆայլերի հոսթինգի ծառայությունները։ Հավելվածի նախկին տարբերակները բաց կոդով մատչելի էին GitHub-ում, բայց վերջին տարբերակները Google-ի սեփականությունն են[4]։

Օգտագործման օրինակ[խմբագրել | խմբագրել կոդը]

Որպես կանոն, ի սկզբանե օգտատերերը պետք է հավելվածը ներբեռնեն և տեղադրեն իրենց բջջային սարքերում։ Կայք մուտք գործելու կամ ծառայության ծառայություններով օգտվելու համար, պետք է ներմուծել մասնակցային հաշիվը և գաղտնաբառը, բացել Authenticator հավելվածը և հատուկ դաշտում ներմուշել միանգամյա օգտագործման համար նախատեսված գաղտնաբառը։

Դրա համար կայքը օգտագիրոջը տրամադրում է ընդհանուր գաղտնի բանալի, որը պետք է պահպանված լինի Google Authenticator հավելվածում։ Այդ գաղտնի բանալին կօգտագործվի բոլոր հետագա կայք մուտքերի համար։

Երկփուլ աուտենտիֆիկացման շնորհիվ գաղտնաբառի/մասնակցային հաշվի իմացությունը բավական չէ մասնակցային հաշիվը ջարդելու համար։ Չարագործը նաև պետք է իմանա գաղտնի բանալին կամ պետք է Google Authenticator-ով սարքին ֆիզիկական մուտք ունենա։ Այլընտրանքային տարբերակ է MITM հարձակումը՝ եթե օգտատիրոջ համակարգիչը վարակված է տրոյանով, ապա մասնակցային հաշիվը, գաղտնաբառը և միանգամյա օգտագործման համար նախատեսված գաղտնաբառը կարող են խափանվել՝ սեփական մուտքի սեսսիան նախաձեռնելու կամ օգտատիրոջ ու կայքի միջև ինֆորմացիան փոփոխելու համար։

Իրականացումներ[խմբագրել | խմբագրել կոդը]

Google Authenticator տրամադրված է Android[5], BlackBerry-ի, և iOS-ի համար[6]։ Նաև առկա են մի քանի կողմնակի իրականացումներ՝

  • Windows Phone 7.5/8/8.1/10: Microsoft Authenticator[7] Virtual TokenFactor[8]
  • Windows Mobile: Google Authenticator for Windows Mobile[9]
  • Java CLI: Authenticator.jar[10]
  • Java GUI: JAuth[11] FXAuth[12]
  • J2ME: gauthj2me[13] lwuitgauthj2me[14] Mobile-OTP (Chinese only)[15] totp-me[16]
  • Palm OS: gauthj2me[17]
  • Python: onetimepass[18]
  • PHP: GoogleAuthenticator.php[19]
  • Ruby: rotp[20], twofu[21]
  • Rails: active_model_otp[22] (third party implementation)
  • webOS: GAuth[23]
  • Windows: gauth4win[24] MOS Authenticator[25] WinAuth[26]
  • .NET: TwoStepsAuthenticator[27]
  • HTML5: html5-google-authenticator[28]
  • MeeGo/Harmattan (Nokia N9): GAuth[29]
  • Sailfish OS: SGAuth[30], SailOTP[31]
  • Apache: Google Authenticator Apache Module[32]
  • PAM: Google Pluggable Authentication Module[33] oauth-pam[34]
  • Backend: LinOTP (Management Backend implemented in python)
  • Chrome/Chrome OS: Authenticator[35]
  • iOS: OTP Auth[36]

Տեխնիկական բնութագիր[խմբագրել | խմբագրել կոդը]

Ծառայություն մատուցողը յուրաքանչյուր օգտատիրոջ համար ստանում է 80-բիթանոց գաղտնի բանալի (սակայն RFC 4226 §4-ը պահանջում է նվազագույնը 128 բիթ և խորհուրդ է տալիս 160 բիթ)[37]։ Բանալին տրամադրվում է Base32 կոդավորմամբ 16-, 26-, 32-նիշանի տողի կամ QR-կոդի տեսքով։ Գաղտնի բանալու միջոցով կլիենտը ստեղծում է HMAC-SHA1

  • TOTP-ի տարբերակի համար՝ «UNIX-ի դարաշրջանի» 30-վայրկյանանոց ինտերվալների քանակից
  • և հաշվիչից, որը մեծացվում է ամեն HOTP տարբերակի համար ամեն նոր կոդով։

Հետո HMAC -ի մի մաս հանվում է փոխակերպվում է 6-նիշանի կոդի։

Կեղծ կոդ Time-based OTP-ի համար[խմբագրել | խմբագրել կոդը]

  function GoogleAuthenticatorCode(string secret)
      key := base32decode(secret)
      message := floor(current Unix time / 30)
      hash := HMAC-SHA1(key, message)
      offset := last nibble of hash
      truncatedHash := hash[offset..offset+3]  //4 bytes starting at the offset
      Set the first bit of truncatedHash to zero  //remove the most significant bit
      code := truncatedHash mod 1000000
      pad code with 0 until length of code is 6
      return code

Կեղծ կոդ Event/Counter OTP-ի համար[խմբագրել | խմբագրել կոդը]

  function GoogleAuthenticatorCode(string secret)
      key := base32decode(secret)
      message := counter encoded on 8 bytes
      hash := HMAC-SHA1(key, message)
      offset := last nibble of hash
      truncatedHash := hash[offset..offset+3]  //4 bytes starting at the offset
      Set the first bit of truncatedHash to zero  //remove the most significant bit
      code := truncatedHash mod 1000000
      pad code with 0 until length of code is 6
      return code

Ծանոթագրություններ[խմբագրել | խմբագրել կոդը]

  1. «Google Is Making Your Account Vastly More Secure With Two-Step Authentication - TechCrunch». TechCrunch. 2010 թ․ սեպտեմբերի 20. Վերցված է 2016 թ․ մարտի 12-ին.
  2. https://gitlab.com/fdroid/fdroiddata/commit/978d5782d61c29a809f25a5fc0b67345c17b2827
  3. «GitHub - google/google-authenticator: Open source version of Google Authenticator (except the Android app)». GitHub (անգլերեն). Google. «These implementations support the HMAC-Based One-time Password (HOTP) algorithm specified in RFC 4226 and the Time-based One-time Password (TOTP) algorithm specified in RFC 6238
  4. Willis, Nathan (22 January 2014)."FreeOTP multi-factor authentication". LWN.net. Retrieved 10 August 2015.
  5. https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 A
  6. «Google Authenticator». App Store.
  7. «Authenticator». 2013 թ․ ապրիլի 4.
  8. «Virtual TokenFactor». 2012 թ․ փետրվարի 26.
  9. «[APP]Google Authenticator for Windows Mobile». XDA Developers.
  10. «http://blog dot jamesdotcuff dot net». Արխիվացված է օրիգինալից 2014 թ․ օգոստոսի 1-ին. Վերցված է 2018 թ․ հունվարի 20-ին.
  11. «mclamp/JAuth». GitHub.
  12. «kamenitxan/FXAuth». GitHub.
  13. «gauthj2me - Google Authentification in Java Mobile, j2me - Google Project Hosting».
  14. «lwuitgauthj2me - Google Authenticator for J2ME phones - Google Project Hosting».
  15. «chunlinyao / mobile-otp — Bitbucket». Արխիվացված է օրիգինալից 2017 թ․ հոկտեմբերի 15-ին. Վերցված է 2018 թ․ հունվարի 20-ին.
  16. «totp-me - TOTP for Java ME - Google authenticator».
  17. «gauth.prc - gauthj2me - Google Authenticator for Palm OS (converted from java) - Google Authentification in Java Mobile, j2me - Google Project Hosting».
  18. «tadeck/onetimepass». GitHub.
  19. «chregu/GoogleAuthenticator.php». GitHub.
  20. «rotp - RubyGems.org - your community gem host».
  21. «ukazap/twofu». GitHub.
  22. «heapsource/active_model_otp». GitHub.
  23. «GAuth».
  24. «gauth4win - Google Authenticator for windows - Google Project Hosting».
  25. «MOS Authenticator Home».
  26. «winauth - Windows Authenticator for Battle.net / World of Warcraft / Guild Wars 2 / Glyph / WildStar / Google / Bitcoin - Google Project Hosting».
  27. «glacasa/TwoStepsAuthenticator». GitHub.
  28. «gbraad/html5-google-authenticator». GitHub.
  29. Techtransit. «Nokia Store: Download GAuth and many other games, wallpaper, ringtones and mobile apps on your Nokia phone». Արխիվացված է օրիգինալից 2014 թ․ հուլիսի 12-ին. Վերցված է 2018 թ․ հունվարի 20-ին.
  30. «SGAuth». Արխիվացված է օրիգինալից 2019 թ․ հուլիսի 11-ին. Վերցված է 2018 թ․ հունվարի 20-ին.
  31. «SailOTP».
  32. «google-authenticator-apache-module - Apache Module for Two-Factor Authentication via Google Authenticator - Google Project Hosting».
  33. «google-authenticator - Two-step verification - Google Project Hosting».
  34. «oauth-pam - PAM for use with OAuth Websites - Google Project Hosting».
  35. «Authenticator».
  36. «OTP Auth». App Store.
  37. https://tools.ietf.org/html/rfc4226#section-4

Արտաքին հղումներ[խմբագրել | խմբագրել կոդը]