公私钥加解密问题汇总

2023-11-05 03:32
文章标签 问题 汇总 加解密 公私

本文主要是介绍公私钥加解密问题汇总,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

  1. A is sending a message to B (using public key infrastructure). What kind of key is used for encryption (for the purpose of confidentiality)?
    B’s public key.
    加密用接收方公钥

  2. A is sending a message to B (using public key infrastructure). What kind of key is used for encryption (for the purpose of authentication)?
    A’s private key.
    验证用发送方私钥

  3. Which question (#1 or #2) is related to digital signature? Explain in detail.
    #2, true party’s public key to authenticate.

  4. A is sending a message to B using a symmetric key encryption. Explain the mechanism including key sharing.
    A will use B’s public to encrypt the symmetric key, B can use its own private key to decrypt it.

    4-1. Explain what digital envelope is in Question 4.
    Digital envelope is the method to use symmetric key encryption to encrypt document but public key encryption to encrypt and send symmetric key, just like to put a key into an envelope.

  5. How do you verify digital signature? Especially what information do you need for verification? Discuss it in detail
    The receiver gets the massage and he/she will decrypt first and hash the plaintext with the same hashing algorithm the sender used; and then decrypt the DS with the true party’s public key. If the 2 match, the message is authenticated.
    Third party?

  6. How can hashing be used to achieve integrity? Explain with an example.
    Integrity means that the message cannot be changed or, if it is changed, that this change will be detected. The hashing is using a method to calculate and it will generate shorter length message which cannot be reversed, if the both sides can use the same hashing method generate the same result, that means the both sides achieve the integrity.

  7. Can you use hashing for authentication? Why or why not. Explain in detail.
    Yes, the MS-CHAP Challenge-Response Authentication Protocol using hashing to authenticate.

  8. A is sending a message to B. A and B agree that digital signature(Q2), digital certificate(Q5), and digital envelope(Q4) need to be used. Describe the detailed mechanism to use those three notions in their communication.
    整个传递过程是:
    (1)发送方A先形成DS(MD+发送方私钥加密),将DS attach到 plaintext上,形成 DS+plaintext,然后在用symmetric key加密;
    (2)发送给接收方B;
    (3)B接收到信息,先用symmetric key解密,然后再验证DS。即,先用true party的public key解密。其实这里的key来自于第三方的CA,而CA也相当于一套公私钥加解密机制,但是是早就install在你的OS里面了,这个部分就叫做数字证书。然后解密得到MD,再自己hash plaintext得到一个MD,比较得出完整性和验证发送者。
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述

  9. Message-by-Message Authentication?
    不必每一个message都验证,可以在上层控制,类似于流机制

  10. HMAC
    这里写图片描述
    这里写图片描述
    这里写图片描述

  11. symmetric key加密发送的时候,因为已经用了PKI机制,不用再加DS。

这篇关于公私钥加解密问题汇总的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/347143

相关文章

SpringBoot启动报错的11个高频问题排查与解决终极指南

《SpringBoot启动报错的11个高频问题排查与解决终极指南》这篇文章主要为大家详细介绍了SpringBoot启动报错的11个高频问题的排查与解决,文中的示例代码讲解详细,感兴趣的小伙伴可以了解一... 目录1. 依赖冲突:NoSuchMethodError 的终极解法2. Bean注入失败:No qu

MySQL新增字段后Java实体未更新的潜在问题与解决方案

《MySQL新增字段后Java实体未更新的潜在问题与解决方案》在Java+MySQL的开发中,我们通常使用ORM框架来映射数据库表与Java对象,但有时候,数据库表结构变更(如新增字段)后,开发人员可... 目录引言1. 问题背景:数据库与 Java 实体不同步1.1 常见场景1.2 示例代码2. 不同操作

如何解决mysql出现Incorrect string value for column ‘表项‘ at row 1错误问题

《如何解决mysql出现Incorrectstringvalueforcolumn‘表项‘atrow1错误问题》:本文主要介绍如何解决mysql出现Incorrectstringv... 目录mysql出现Incorrect string value for column ‘表项‘ at row 1错误报错

如何解决Spring MVC中响应乱码问题

《如何解决SpringMVC中响应乱码问题》:本文主要介绍如何解决SpringMVC中响应乱码问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Spring MVC最新响应中乱码解决方式以前的解决办法这是比较通用的一种方法总结Spring MVC最新响应中乱码解

pip无法安装osgeo失败的问题解决

《pip无法安装osgeo失败的问题解决》本文主要介绍了pip无法安装osgeo失败的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一... 进入官方提供的扩展包下载网站寻找版本适配的whl文件注意:要选择cp(python版本)和你py

解决Java中基于GeoTools的Shapefile读取乱码的问题

《解决Java中基于GeoTools的Shapefile读取乱码的问题》本文主要讨论了在使用Java编程语言进行地理信息数据解析时遇到的Shapefile属性信息乱码问题,以及根据不同的编码设置进行属... 目录前言1、Shapefile属性字段编码的情况:一、Shp文件常见的字符集编码1、System编码

Spring MVC使用视图解析的问题解读

《SpringMVC使用视图解析的问题解读》:本文主要介绍SpringMVC使用视图解析的问题解读,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Spring MVC使用视图解析1. 会使用视图解析的情况2. 不会使用视图解析的情况总结Spring MVC使用视图

Redis解决缓存击穿问题的两种方法

《Redis解决缓存击穿问题的两种方法》缓存击穿问题也叫热点Key问题,就是⼀个被高并发访问并且缓存重建业务较复杂的key突然失效了,无数的请求访问会在瞬间给数据库带来巨大的冲击,本文给大家介绍了Re... 目录引言解决办法互斥锁(强一致,性能差)逻辑过期(高可用,性能优)设计逻辑过期时间引言缓存击穿:给

Java程序运行时出现乱码问题的排查与解决方法

《Java程序运行时出现乱码问题的排查与解决方法》本文主要介绍了Java程序运行时出现乱码问题的排查与解决方法,包括检查Java源文件编码、检查编译时的编码设置、检查运行时的编码设置、检查命令提示符的... 目录一、检查 Java 源文件编码二、检查编译时的编码设置三、检查运行时的编码设置四、检查命令提示符

Jackson库进行JSON 序列化时遇到了无限递归(Infinite Recursion)的问题及解决方案

《Jackson库进行JSON序列化时遇到了无限递归(InfiniteRecursion)的问题及解决方案》使用Jackson库进行JSON序列化时遇到了无限递归(InfiniteRecursi... 目录解决方案‌1. 使用 @jsonIgnore 忽略一个方向的引用2. 使用 @JsonManagedR