## PAKE (password authenticated key exchange) [PAKE](https://en.wikipedia.org/wiki/Password-authenticated_key_agreement)는 두명 이상의 참여자가 패스워드 기반으로 암호화된 채널을 만들어서 서로 통신할 수 있게 해주는 암호학 적인 방법을 말한다. * Balanced PAKE * 참여자들이 서로 암호화된 채널을 만드는 과정을 위해 동일한 패스워드를 사용하는 방법 * Augmented PAKE * server/client 시나리오에서 많이 사용된다. * 서버는 어떤 password-equivalent 데이터도 저장하지 않는다. (서버는 password로 부터 계산된 값을 보관하고 있지만 이 값으로는 원래 password를 역추론할 수 없다. 이 외에도 password를 역추론 해 낼 수 있는 관련 정보는 저장하지 않는다.) * 클라이언트가 서버에 인증을 시도할 때도 password를 역추론 해 낼 수 있는 직접적인 정보는 클라이언트에서 서버로 절대로 전송되지 않는다. * 때문에 공격자가 서버의 데이터를 접근 권한을 탈취했다고 하더라도 해당 데이터로 부터 password를 brute force로 찾아내기 전에는 client를 impersonate 하는 것이 불가능하다. ## SRP (Secure Remote Password) Protocol [SRP 프로토콜](https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol)은 기존 특허를 피해서 만들어진 augmented PAKE의 한 종류이다. 인증 과정에서 password를 유추할 수 있는 직접적인 정보가 원격지로 전달되지 않아서 안전하다는 뜻으로 이름을 이해하면 될 것 같다. (이 이름이 지어진 정확한 기원은 찾지 못했다) SRP protocol은 여러번 수정되어왔고 현재는 revision 6a 버전이다. * 각 참여자가 인증을 위해 알고있어야 하는 정보 * 클라이언트 - 사용자의 패스워드(password) * 서버 - 사용자가 가입할때 입력한 ID, password로부터 유도된 cryptographic verifier, salt를 보관 * x = hash(salt, password) * verifier = g^x * 주의: x는 password를 추측해 낼 수있는 값이기 때문에 verifier를 만들고난 후 저장하지 않고 버린다. * 인증 흐름 (password를 직접 보내지 않고, 클라이언트가 password를 알고있다 라는 것을 증명하기 위한 절차) * *주의: 아래 절차는 매 로그인 시도 마다 처음부터 반복된다.* * 참고: [https://github.com/mozilla/node-srp](https://github.com/mozilla/node-srp) 에 더 실용적인 설명이 잘되어있다. * 클라이언트(a), 서버(b) 에서 각각 하나씩 랜덤 값 생성 * 클라에서 UserID, A = g^a 를 서버로 전송하면 서버는 salt, B = kv + g^b 를 돌려줌 * k값은 클라/서버 모두 미리 알고있는 값 * 현재까지 공유된 정보들과 원래 알고 있는 정보를 통해 서버/클라이언트에서 각각 공유된 세션 키 K를 계산해 낸다. (클라이언트에서 세션키 K를 계산해내는데 패스워드가 필요하다) * 이 K를 사용하여 차후에 채널을 암호화 하는데 이용할 수있다. * 세션 키와 별도로 수학적 계산을 통해 M1을 계산 후 서버로 전송하면 M1을 서버에서 확인. (실제 이 단계에서 실제 인증이 완료된다) * M1이 맞는 값임이 판별되면 클라에서 입력한 패스워드가 맞다는 의미 - 이때 서버/클라가 각자 계산했던 세션키 K는 동일한 값인 것을 확인 가능 * M1이 틀리게 판별된 경우, 클라에서 입력한 패스워드가 틀렸다는 의미 - 이때 서버/클라가 각자 계산했던 세션키 K는 동일하지 않다. * 장점 * 인증 성공시 cryptographically-strong secret을 client/server 모두 획득하게된다. 이를 이용하여 참여자간 암호화된 통신이 가능. * 인증 + 암호화된 통신 두가지 기능이 모두 필요한 경우에 매우 유용하고 SSH보다 더 안전함 * SRP 레벨에서 암호화된 통신을 지원하므로 Trusted key servers와 certificate infrastructures (ex: SSL) 없이도 안전한 통신이 가능하고, 별도의 layer이기 때문에 두가지를 같이 사용하는것도 가능하다. * zero-knowledge password proof (ZKPP) 를 구현 * 한 참여자 (the prover, 보통 클라이언트)가 다른 참여자 (the verifier, 보통 서버)에게 “암호를 알고있다는 사실” 외에는 아무것도 밝히지 않고서도 자신이 암호를 알고있다는 것을 증명하는 방법 * 어떤 참여자들도 다른 참여자 모르게 암호가 맞는지 확인 하는 것이 불가능하다. 즉, 암호가 맞는지 확인할 때마다 참여자들간에 한번의 인터랙션이 요구된다. * 때문에 offline dictionary attacks 에 대해서도 안전하다 * weak passwords를 사용하더라도 안전한 편 * 독립적인 trusted third party 가 필요 없다 (Kerberos protocol의 경우 신뢰할 수있는 별도의 인증 서버가 필요함) * 기존 방식의 경우 MITM 공격에 의해 전송된 password가 한번 노출되면, 이를 replay해서 경우 공격자가 사용자를 지속적으로 가장(impersonate)하는 것이 가능했다. * 하지만 SRP의 경우 특정 사용자에 대해 인증이 MITM에 의해 한번 노출되더라도 공격자가 해당 사용자를 지속적으로 impersonate할 수 없다. 패스워드를 직접적으로 유추할 수있는 정보가 전송되지 않으며, 그마저도 매 로그인 시도마다 클라이언트/서버간에 랜덤값 교환 절차가 포함되어있어서 값이 계속 변경되기 때문 ## 실제 사용 예시 * AWS Cognito의 User Pool에 대해 인증을 할때 InitiateAuth API의 AuthFlow를 USER_SRP_AUTH 로 설정할 경우 SRP protocol에 따라 로그인을 진행 할 수 있다. * 클라에서 USERNAME, SRP_A(A의 역할)를 Cognito server로 전송하면 Session과 PASSWORD_VERIFIER(B의 역할)를 돌려받는다. * 클라에서 PASSWORD_VERIFIER를 이용하여 최종적으로 M1을 계산 후, 해당값을 Session과 함께 RespondToAuthChallenge API에 넣어서 보내면 인증이 완료되고 OpenID Connect Token을 응답으로 돌려받는다. * 참고: 이 과정들은 AWS SDK에 의해 핸들링 되기때문에 직접 뭔가를 구현 할 필요는 없다. * [https://docs.aws.amazon.com/ko_kr/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html](https://docs.aws.amazon.com/ko_kr/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html) * [https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_InitiateAuth.html](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_InitiateAuth.html) * [https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RespondToAuthChallenge.html](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RespondToAuthChallenge.html)
author | yjiq150 |
---|---|
permlink | pake-srp-protocol |
category | kr |
json_metadata | {"tags":["kr","kr-dev","crypto","auth"],"links":["https://en.wikipedia.org/wiki/Password-authenticated_key_agreement","https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol","https://github.com/mozilla/node-srp","https://docs.aws.amazon.com/ko_kr/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html","https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_InitiateAuth.html","https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RespondToAuthChallenge.html"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-11-04 17:10:06 |
last_update | 2018-11-05 09:40:42 |
depth | 0 |
children | 1 |
last_payout | 2018-11-11 17:10:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 7.302 HBD |
curator_payout_value | 2.331 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4,217 |
author_reputation | 2,831,815,720,339 |
root_title | "PAKE와 SRP Protocol을 이용한 인증" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,671,662 |
net_rshares | 8,587,532,844,190 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
eforucom | 0 | 2,915,010,370 | 1.11% | ||
nukunit | 0 | 12,613,863,393 | 100% | ||
heather2222 | 0 | 77,128,212 | 100% | ||
clarkgold | 0 | 35,054,590,305 | 100% | ||
bramd | 0 | 8,155,572,673,452 | 100% | ||
wabangcute | 0 | 89,653,940,445 | 100% | ||
minampusan | 0 | 186,892,667 | 100% | ||
mishana | 0 | 11,383,509,572 | 60% | ||
dennis76 | 0 | 2,625,339,098 | 100% | ||
kyunga | 0 | 116,069,852,645 | 100% | ||
opsteemit | 0 | 11,589,890,888 | 100% | ||
sunstrip | 0 | 5,364,838,205 | 100% | ||
sd974201 | 0 | 1,253,733,128 | 4% | ||
kyle-event | 0 | 62,312,109,739 | 100% | ||
anpigon | 0 | 15,678,675,857 | 50% | ||
bogeva | 0 | 544,893,743 | 100% | ||
borndead03 | 0 | 545,125,924 | 100% | ||
petrenkosashka | 0 | 545,292,208 | 100% | ||
ingakoral | 0 | 544,546,829 | 100% | ||
antonstarik | 0 | 544,651,069 | 100% | ||
bestgirl | 0 | 545,351,575 | 100% | ||
zoraivanov92 | 0 | 544,360,160 | 100% | ||
council | 0 | 621,462,429 | 10% | ||
moreone | 0 | 544,646,147 | 100% | ||
danielnewsomm | 0 | 544,875,031 | 100% | ||
pairplay | 0 | 19,730,690,401 | 10% | ||
assaulenko | 0 | 544,431,989 | 100% | ||
evasivepike | 0 | 544,242,375 | 100% | ||
roosterwage | 0 | 544,155,227 | 100% | ||
graybeacons | 0 | 544,155,667 | 100% | ||
gallopescabeche | 0 | 544,345,243 | 100% | ||
pointingevasive | 0 | 544,046,962 | 100% | ||
headerharem | 0 | 543,857,132 | 100% | ||
decagonour | 0 | 544,464,312 | 100% | ||
elidirbrown | 0 | 543,973,700 | 100% | ||
nikolastelma | 0 | 544,074,301 | 100% | ||
pairplay1 | 0 | 2,174,975,185 | 100% | ||
elenatagaeva | 0 | 544,374,266 | 100% | ||
rodionrasaev | 0 | 544,946,569 | 100% | ||
andreiakilov | 0 | 545,221,219 | 100% | ||
antalovaelena | 0 | 544,543,587 | 100% | ||
sryakovl88ev | 0 | 544,637,712 | 100% | ||
dinasamoilova | 0 | 544,378,392 | 100% | ||
joinneutron | 0 | 544,367,227 | 100% | ||
bustlingparched | 0 | 545,118,681 | 100% | ||
creamssugar | 0 | 545,072,079 | 100% | ||
suburbanmammary | 0 | 545,295,896 | 100% | ||
pairplay-en | 0 | 8,614,250 | 100% | ||
pairplay-en1 | 0 | 25,134,349 | 100% | ||
lotgreasy | 0 | 544,777,869 | 100% | ||
mischiefrunner | 0 | 545,660,109 | 100% | ||
xebeclist | 0 | 545,461,989 | 100% | ||
grouseunhelpful | 0 | 544,633,863 | 100% | ||
huskyelectron | 0 | 545,201,198 | 100% | ||
rlazarev88w | 0 | 545,337,909 | 100% | ||
criticizemars | 0 | 545,294,079 | 100% | ||
eggyrothwell | 0 | 545,755,139 | 100% | ||
curryvoid | 0 | 544,813,083 | 100% | ||
lobestay | 0 | 545,205,580 | 100% | ||
zeniththrash | 0 | 546,208,955 | 100% | ||
soulfulurban | 0 | 545,923,065 | 100% | ||
tobireynol | 0 | 546,894,099 | 100% | ||
umaykl | 0 | 546,589,571 | 100% | ||
roman.senchukov | 0 | 547,096,917 | 100% | ||
sergeyrevutskiy | 0 | 546,697,910 | 100% | ||
kostya.borisenko | 0 | 546,913,639 | 100% | ||
nikbelin1983 | 0 | 546,554,719 | 100% | ||
sashokbad | 0 | 546,956,449 | 100% | ||
annagalic | 0 | 546,165,035 | 100% | ||
nikfrol1983 | 0 | 546,821,753 | 100% | ||
corpusclerobotic | 0 | 547,892,932 | 100% | ||
bangersmippery | 0 | 547,858,928 | 100% | ||
pakistaniride | 0 | 548,418,065 | 100% | ||
clickingblush | 0 | 548,869,137 | 100% | ||
antonsergienko | 0 | 548,772,599 | 100% | ||
butenko.serg | 0 | 548,451,679 | 100% | ||
vladlenkonkol | 0 | 549,017,143 | 100% | ||
bornnonben | 0 | 548,011,680 | 100% | ||
moistcurse | 0 | 548,932,931 | 100% | ||
germharmony | 0 | 548,097,819 | 100% | ||
bubbishninks | 0 | 549,022,655 | 100% | ||
crumphume | 0 | 548,667,036 | 100% | ||
traitssnapper | 0 | 548,997,937 | 100% | ||
monescevian | 0 | 548,955,126 | 100% | ||
skiadhoc | 0 | 548,349,205 | 100% | ||
makingcrackling | 0 | 548,892,640 | 100% | ||
internetherpes | 0 | 548,849,366 | 100% | ||
retrievedfale | 0 | 549,082,510 | 100% | ||
bioticresistor | 0 | 548,768,396 | 100% | ||
imaginaryleep | 0 | 548,840,268 | 100% | ||
starotter | 0 | 547,983,325 | 100% | ||
heenseahorse | 0 | 548,464,240 | 100% | ||
snugglyugly | 0 | 547,895,936 | 100% | ||
planitiakite | 0 | 548,765,088 | 100% | ||
glyderaubeaf | 0 | 548,764,652 | 100% | ||
storundesongstuf | 0 | 548,922,903 | 100% | ||
trouvwabeavit | 0 | 548,921,377 | 100% | ||
rilityfonid | 0 | 549,045,875 | 100% |
Congratulations @yjiq150! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) : <table><tr><td>https://steemitimages.com/60x70/http://steemitboard.com/@yjiq150/votes.png?201811200231</td><td>You made more than 800 upvotes. Your next target is to reach 900 upvotes.</td></tr> </table> <sub>_[Click here to view your Board of Honor](https://steemitboard.com/@yjiq150)_</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> **Do not miss the last post from @steemitboard:** <table><tr><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-the-results-the-winners-and-the-prizes"><img src="https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png"></a></td><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-the-results-the-winners-and-the-prizes">Meet the Steemians Contest - The results, the winners and the prizes</a></td></tr><tr><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-special-attendees-revealed"><img src="https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png"></a></td><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-special-attendees-revealed">Meet the Steemians Contest - Special attendees revealed</a></td></tr><tr><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-intermediate-results"><img src="https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png"></a></td><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-intermediate-results">Meet the Steemians Contest - Intermediate results</a></td></tr></table> > Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
author | steemitboard |
---|---|
permlink | steemitboard-notify-yjiq150-20181120t095840000z |
category | kr |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2018-11-20 09:58:39 |
last_update | 2018-11-20 09:58:39 |
depth | 1 |
children | 0 |
last_payout | 2018-11-27 09:58:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,151 |
author_reputation | 38,975,615,169,260 |
root_title | "PAKE와 SRP Protocol을 이용한 인증" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 75,606,915 |
net_rshares | 0 |