这个文档用来搜集归纳日常见到的技术细节问题包括:Util code blocks, problem analysis,技术博客/podcasts 书签 etc ,后期可能会因为篇幅受限而将某些部份提炼为新的文章并通过hyperlink跳转。
HSP-Java-Chapter-10
Symbols count in article: 0 Reading time ≈ 1 mins.
AI-WhitePage
Symbols count in article: 622 Reading time ≈ 1 mins.
This is the blog for collecting the fast booming AI information pieces into one place as a navigator for later-on reference. It’s just a navigator, to dig deeper, you still need to do loads of research after entering the AI world from here.
Python-Fundamentals
Symbols count in article: 127 Reading time ≈ 1 mins.
This is the notes token from the [python3 fundamentals-Udemy]https://hta.udemy.com/course/python3-fundamentals/).
Oauth2.0-and-OpenID-Connect
Symbols count in article: 6.5k Reading time ≈ 6 mins.
Symmetric encryption:
It depends on a secret whihc should be known to both parties of the data transferring.
Asymmetric encryption:
Below is the OAuth2 notes taken from UDemy
1 | # 用base64编码文件 e.g.图片 然后输出到到文件 txt |
1 | # dgst 代表 digest |

1 | # |
1 | # openssl passwd 会在生成hash前默认加盐, -6 表示使用sha512 |
注意⚠️:
Mac 系统有些可以在Linux正常执行并返回结果的openssl命令不生效的原因:
1 | # 为了临时用默认openssl 需要调用全路径。 如果需要永久切换为传统openssl,要改环境变量 |
用openssl随机提供的salt时,每次生成的hash都不一样, 见下图1&2, 当自己指定salt时,一样,见下图3&4:
1 | echo -n "Danger. Run now." | /opt/homebrew/opt/openssl@1.1/bin/openssl enc -aes-256-cbc -k secret -md sha1 -pbkdf2 |
1 | # encrypt |
这个 openssl enc命令是用 AES-256-CBC 算法加密文件的操作,结合了 PBKDF2 密钥派生和 Base64 编码,适合将二进制文件(如图片)转为可文本存储的加密结果。以下是逐参数拆解+整体逻辑的详细解释:
一、核心命令结构
openssl enc是 OpenSSL 的对称加密/解密子命令(enc= encode/decode),用于对文件进行加密(-in输入、-out输出)或解密(-d选项)。本命令是加密操作(无 -d),完整逻辑是:
用密码派生密钥 → AES-256-CBC 加密 → Base64 编码 → 输出密文
二、逐参数解释
| 参数 | 含义与作用 |
|---|---|
enc |
OpenSSL 的子命令,代表“对称加密/解密”(symmetric encryption/decryption)。 |
-aes-256-cbc |
加密算法+模式: - aes-256:使用 AES 对称加密算法,密钥长度 256 位(高安全性); - cbc:使用 CBC 模式(密码块链,Chain Block Cipher),需配合盐(salt)和初始化向量(IV)防止重复加密相同明文。 (注:AES 还有 GCM 等更安全的模式,但 CBC 是经典模式。) |
-k secret |
指定密码(Passphrase):-k后接的字符串 secret是加密用的“原始密码”。OpenSSL 会通过密钥派生函数(KDF)将这个密码转为 AES 所需的 256 位密钥。 (⚠️ 注意:密码越复杂越安全,secret是示例,实际需换强密码。) |
-md sha1 |
指定 KDF 的哈希算法:-md定义密钥派生时使用的消息摘要算法(此处为 SHA-1)。结合后面的 -pbkdf2,实际是PBKDF2-HMAC-SHA1(PBKDF2 用 HMAC-SHA1 作为伪随机函数)。 (注:现代推荐用 -md sha256,SHA-1 已不够安全,但命令中用了 SHA-1。) |
-pbkdf2 |
启用 PBKDF2 密钥派生: PBKDF2(Password-Based Key Derivation Function 2)是一种安全的密钥派生标准(替代 OpenSSL 旧版的 EVP_BytesToKey方法),通过盐(salt)+ 多次迭代哈希将弱密码转为强密钥,抵御暴力破解。 默认迭代次数通常为 10000 次(可通过 -iter自定义)。 |
-base64 |
输出 Base64 编码:加密后的结果是二进制数据,用 -base64转为可打印的 ASCII 文本(方便存储/传输,如邮件、配置文件)。 (解密时需用 -base64反向解码,或直接用 -A选项处理单行 Base64。) |
-in a.png |
输入文件:指定要加密的原始文件(此处是图片 a.png)。 |
-out a-enc |
输出文件:指定加密后的结果文件(此处为 a-enc,内容是 Base64 编码的密文)。 |

Asymmetric Encryption
1 | # generate a private key in a file called private.key and a self-signed X509 certificate |
1 | # generateing private key for alice & bob respectively |
1 | # generateing ENCRYPTED(via aes256) private key for alice & bob respectively |
Above are generated with passphrase being ALICE & BOBS respectively. ()
1 | # generate the public key with the private key |
1 | # prepare a txt file for encryption soon |

Hybrid Encryption
1 | # RSA key size must NOT greater than 245. that's the reason why using 245 here |
Digital Signature Demo
1 | openssl dgst -sha512 -sign alice-private.pem -out testingImg-digest.sign testingImg.png |
Linux-03
Symbols count in article: 838 Reading time ≈ 1 mins.
This Chapter covers the Linux Access Management. (Owner, Group, Other)
Linux-02
Symbols count in article: 0 Reading time ≈ 1 mins.
Linux-01
Symbols count in article: 0 Reading time ≈ 1 mins.
Chapter06-Apache_NiFi_Registry_Installation_and_Use_Case
Symbols count in article: 0 Reading time ≈ 1 mins.
Chapter04-Apache_NiFi_Logging_Explained
Symbols count in article: 1.1k Reading time ≈ 1 mins.
All that discussed in this chapter can be found here in official doc