久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

“秘密"應該是什么?在智威湯遜?

What should be the quot;Secretquot; in JWT?(“秘密應該是什么?在智威湯遜?)
本文介紹了“秘密"應該是什么?在智威湯遜?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我打算將 JWT 應用到我使用 Java-Jersey 開發的 REST API 中.我正在將此庫用于 JWT - https://github.com/auth0/java-jwt

我對 JWT - Secret 有幾個問題

  1. 這個 Secret 必須是唯一的嗎?
  2. 我應該使用用戶密碼的散列版本來保密嗎?(那么無論如何它都不是唯一的)這是因為當用戶更改密碼時,他的令牌將自動失效.

解決方案

  1. 這個 Secret 必須是唯一的嗎?

它應該是您的應用程序獨有的 —畢竟它必須是一個秘密 —但它不會對每個令牌都是唯一的.相反,在任何給定時間,您都應該擁有相對較少數量的密鑰(例如,通常只有一個密鑰,但在從一個密鑰輪換到另一個密鑰時,您會在短時間內擁有兩個密鑰).

<塊引用>

  1. 我應該使用哈希版本的用戶密碼作為密碼嗎?

不,有兩個原因:

  1. 假設您的用戶有一個相對不安全的密碼,例如 GoPackers123.然后,在您的秘密中使用密碼意味著有人可以輕松地測試給定的潛在密碼,看看它是否會產生正確的簽名;而且,更重要的是,他們可以輕松測試大量潛在密碼,看看其中是否有任何一個給出了正確的簽名.這是一次離線攻擊,因此您甚至都不會知道它發生了.
  2. 這將要求您將所有用戶的密碼哈希分發到每個需要保存密碼的系統.如果您的用戶數量很少,這可能會對您的秘密分發機制造成相當嚴重的負擔.

I am going to apply JWT into my REST API developed using Java-Jersey. I am using this library for JWT - https://github.com/auth0/java-jwt

I have few questions about the JWT - Secret

  1. Does this Secret has to be unique?
  2. Shall I use the hashed version of user's password for secret? (Then it is not unique anyway) This is because then when user changed his password, his token will be automatically invalid.

解決方案

  1. Does this Secret has to be unique?

It should be unique to your application — it needs to be a secret, after all — but it won't be unique for each token. Rather, you should have a relatively small number of secret keys at any given time (e.g., usually having just one key, but having brief periods where you have two keys as you rotate from one to the next).

  1. Shall I use the hashed version of user's password for secret?

No, for two reasons:

  1. Suppose that your user has a relatively insecure password, like GoPackers123. Using the password in your secret then means that someone can easily test a given potential password to see if it results in the right signature; and, more to the point, they can easily test huge numbers of potential passwords to see if any of them gives the right signature. This is an offline attack, so you would never even know it happened.
  2. This would require you to distribute all of your users' password hashes to every system that needs to hold the secret. If you have more than a trivial number of users, this can become a pretty serious burden on your secret-distribution mechanism.

這篇關于“秘密"應該是什么?在智威湯遜?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 色天堂视频 | 精品国产91 | 毛片视频免费观看 | 欧美日韩一区二区视频在线观看 | 99re在线视频精品 | av免费看片 | 国产乱码高清区二区三区在线 | 欧美a在线| 女女爱爱视频 | 精品亚洲永久免费精品 | 日韩精品一区二区三区在线播放 | 亚洲欧美日韩精品久久亚洲区 | 91pron在线 | 亚洲免费观看视频网站 | 久久五月婷 | 精品三区 | 国产精品久久久久久久三级 | 亚洲成人综合网站 | 欧美精品久久久久 | 成人激情免费视频 | 亚洲va在线va天堂va狼色在线 | 亚洲成人第一页 | 久草福利| 国产十日韩十欧美 | 日韩久久久久久久久久久 | 伊人成人免费视频 | 亚洲精品白浆高清久久久久久 | 天天干狠狠 | 免费午夜剧场 | 99久久成人 | 日韩精品在线视频 | 精品国产乱码久久久久久a丨 | 亚洲一区二区三区在线视频 | 国产免费一区二区三区 | 美女亚洲一区 | 国产激情视频在线 | 91精品久久久久久久久久 | 一区二区在线 | 99精品欧美一区二区三区 | 国产亚洲精品精品国产亚洲综合 | 人人99|