经过之前的学习,对签名部分已经有了一定的了解
为了加深理解,继续搜索了一些文章学习了一下公钥私钥
虽然众说纷纭,但基本上表达的内容大同小异。
- 公钥是公开的密钥
- 私钥是私密的密钥
1:加密传输
加密解决的是保密性(Confidentiality)
问题
如果A想发给B一段数据,不希望其它任何人看到,需要加密传输。
这时候,A用B的公钥加密数据,因为只有B的私钥才能解密数据,所以其它人即便获取密文也无法解出明文。
(总结:公钥加密,私钥解密)
2:数字签名
数字签名解决的是完整性(Integrity)
以及真实性(Authenticity)
问题
当我发布一段消息(数据),我生成数据HASH,并使用私钥和HASH生成签名,如果通过我的公钥能解密签名,并且数据的HASH值与签名解密出来的HASH相同,则证明这段数据是由我发出(真实性), 并且未经篡改(完整性)
(总结:私钥签名,公钥验证)
关于公钥和私钥
网上很多说法是公私钥是完全对称的,也就是说任何一个都可以用作公钥或者私钥。
但在steemit中是有所区别的,通过私钥可以计算出公钥(或者说公钥是由私钥生成的?),反之则不可以(或者说极为困难?)
以上为个人理解,因为尚处于学习过程中,不代表文中理解正确,仅供参考。
另外数学原理我就不去学了,反正我也学不明白,哭...
另外如有谬误,烦请诸位大神不吝赐教:)
python-steem可以使用如上测试代码,来使用私钥算出公钥。
我使用自己的posting key,对照计算出的公钥与自己的公钥,是完全相同的
具体实现可以参考
python-steem
与python-graphenelib
的对应代码Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
用在加密传输时(RSA),是有点对称。
但后者用处不大。因为公钥是公开的,用私钥加密的文件就是个人人都能解的密件。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
用私钥加密,人人可解,实际上就是签名了。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
感谢指点
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
我(A)持有的私钥,和你(B)的公钥,是毫无关联的,至少在我们没产生任何交易之前是。
A和B交易
A利用B的公钥对要发送的明文进行加密,B利用自己的 私钥进行解密,其中公钥和私钥匙相对的,任何一个作为公钥,则另一个 就为私钥
签名和认证
A用特殊的hash算法,由明文中产生固定长度的摘要,然后利用 自己的私钥对形成的摘要进行加密,这个过程就叫签名
B利用 A的公钥解密被加密的摘要得到结果X,然后对明文也进行hash操 作产生摘要Y.最后,把X和Y作比较。此方式既可以保证A的身份不 可抵赖,又可以保证数据在传输过程中不会被篡改。
个人理解,哈哈哈
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
任何一个作为公钥,则另一个 就为私钥
这就是以讹传讹的典范啊,拍照并偷笑;)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
嘿嘿嘿,感谢我吧,给你提供这么好的反面素材。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
1024个赞
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
既然講到公鑰私鑰(話說鑰字簡化得好厲害啊!),那樓主或大神們可否解我一惑?
我們Steem帳戶的Permissions裡面有4組公私鑰,公鑰人人可見(修正一下:是在steemd中才人人看得到),私鑰要你自己登入後按顯示才有。這些私鑰各自的功能我都大致理解,但,Steem的帳戶名稱,感覺起來就是公鑰的概念啊,那這4組公鑰到底要作什麼用的?
補充,之前大神提過的,似乎可以用active key把別人的posting public key加入自己的posting權限,亦即別人可以代你行post/curate之權。但這件事不也可以用帳號名稱就好了嗎?@@ 這鎖行的鎖跟鑰匙還真是多啊.... 昏~~~
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
公钥和私钥是对应的
这就要求,
两者满足一定的数学关系(具体是啥我就不懂了)
所以用户名来做公钥是行不通的(与私钥配合满足不了数学关系,也就没法实现上述功能)
另外,举例说你换了私钥,因为要满足对应关系,公钥也会做对应修改,但是用户名却不用变。
以上是我个人的理解。
说到别人代行使post/curate权利,一般两种方式:
公钥或用户名
加入到你的公钥列表里注意,这里使用用户名也是可以的,但是本质应该还是通过公钥私钥来实现的。所以即便有了用户名,公钥依然不可少。
以上是个人肤浅理解,仅供参考
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
"满足对应关系" 一語道破啊!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
可以賬戶比喻成房子。而區塊鏈的特點是公開透明,這房子就像個玻璃屋(你屋裡有多少錢,你在屋裡一舉一動,所有人都可以看得一清二楚。)賬戶名有如你的住址,人們可以根據地址往你家寄錢。
memokey 是你的通信公鑰,外人想給你發隱秘信息,可以用它來加密。
postingkey 是大門的鑰匙,能進入你家客廳,為房屋主人做些事情。
activekey 是房門鑰匙,進入房屋核心,行使更高的權利。
多加幾個 postingkey,有如給房子多開幾扇門,只需其中一把門匙就能進入你家。而若你的 postingkey 加了我賬戶名,就相當於建個隧道(單向)把你家大廳和我家貫通,誰能進入我家就也能串到你家。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
您這比喻好啊!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
順便一提與 username 和 password 的關係。
當 Steemit 為你創建一個戶頭時,主要是用這兩個字串來生成四把鑰匙。
所以,任何人只要知道你的 password,就等於掌握了所有四把鑰匙。
(當然,若你曾換過鑰匙則另當別論。)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
學習新知!:)
但請教,你說的password我以為是owner key?剛開帳戶時那個password難道不是owner key?又有點迷糊了...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
你正常途径注册的应该接触不到password:)
如果是用工具piston之类注册的,除了owner key等一堆私钥以外,还有个password
比如你注册个deanliu2,可以指定密码为dl12345
如果你注意一下登陆框,就会发现登陆框密码部分提示为
Password or WIF
也就是说,你可以使用
deanliu2/dl12345
这样的用户名密码组合来登陆网站Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
更正一下,密码和owner key应该是二选一的:)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
那麼,正常註冊的人,也有password嗎?那又是如何決定的?因為正常註冊似乎是不需要設password,系統直接給一個我以為就是owner key的"password"....
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Steemit 界面的運作是,每當新用戶開設賬戶時,會隨機算出一個 password。
(前綴為 P 。。。)
如上所述,這個 password 是用來生成四個密鑰的,它並不是 ownerkey。
(ownerkey 私鑰與其它幾個私鑰一樣,以 WIF 格式,開頭為 5.)
現在如果你嘗試 change password 頁面,那個 generate password 所顯示的也是 password.
目前 Steemit 的 GUI 是不讓用戶自己選擇 password 的,也許是擔心人們會選擇一些安全度不夠高的密碼。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
再次感谢大神的讲解
看来关于这部分,我的理解还有有些偏差:)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
太感謝了,寶貴的課程啊!:) 早些時候,是用戶自選密碼的,我就是這樣。後來才改成這樣的系統隨機產生的模式。
咦?發現大神你是特意轉成繁體字嗎?這麼貼心啊?:)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
私钥可以导出公钥,反向不行。。。这是通则,不是 steemit 特有。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
感谢大神指点
之前网上搜索资料时,看到不少人有类似这样的说法,公钥私钥两者完全相同,那个是公钥哪个是私钥,取决于你公开那个、保留哪个。所以看到steem(bts)中可以用私钥推算出公钥就特别惊讶,以讹传讹害死人啊。
好像bitcoin也一样,可以用私钥算出公钥。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
RSA 的情况是对等的。。。
但币圈都是用 ECC,私钥决定公钥。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
嗯,也就是说谈是否对等,要有个前提(比如说RSA还是ECC之类的)
不能以偏概全
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
看起來挺複雜的,還在摸索中
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit