$ openssl s_client -showcerts -connect irc.nerd2nerd.org:6697 < /dev/null | openssl x509 -sha256 -fingerprint -noout| sed 's/://g'
depth=0 C = DE, ST = Bavaria, L = Wuerzburg, O = Nerd2Nerd, CN = com.nerd2nerd.org, emailAddress = [email protected]
verify error:num=18:self signed certificate
verify return:1
depth=0 C = DE, ST = Bavaria, L = Wuerzburg, O = Nerd2Nerd, CN = com.nerd2nerd.org, emailAddress = [email protected]
verify return:1
DONE
SHA256 Fingerprint=4D484E8D5A6C5A8BA279DB2C4DA064D5A78D9D28C398A631E76D06ABA30ECFB7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <meta charset="utf-8"> | |
| <script> | |
| // convert decimal values to rgb hex color toRGBstring(255, 0, 0) => '#ff0000') | |
| function toRGBstring(r, g, b) { | |
| return '#' + (r<16?'0':'') + r.toString(16) + (g<16?'0':'') + g.toString(16) + (b<16?'0':'') + b.toString(16); | |
| } | |
| // convert rgb hex color to decimal values (e.g. parseRBGstring('#ff0000') => [255, 0, 0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <algorithm> | |
| #include <cstring> | |
| #include <iostream> | |
| #include <iomanip> | |
| void printb(const char* title, const unsigned char *buffer, size_t length) { | |
| int indent = (strlen(title) > 6 ? ((strlen(title) + 2) / 6 + 1) * 6 : 7 + 2); | |
| std::cout << title << ":" << std::string(indent - strlen(title) - 2, ' '); | |
| for(size_t i = 0; i < length; i++) { | |
| std::cout << ((i != 0 && i % 16 == 0) ? "\n" + std::string(indent, ' ') : " "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="module"> | |
| import CompactEncrypt from './jose/jwe/compact/encrypt.js' | |
| import CompactDecrypt from './jose/jwe/compact/decrypt.js' | |
| import generateKeyPair from './jose/util/generate_key_pair.js' | |
| import parseJwk from './jose/jwk/parse.js' | |
| const inputElement = document.getElementById("input"); |
The need to secure tokens comes from a number concerns, any of which may apply to your particular use case:
- Integrity: Verify that the token has not been tampered with
- Authenticity: The origin of the token can be verified
- Non-repudiation: The authenticity and integrity of the token is verifiable by third parties
- Confidentiality: Token payload is kept secret from unauthorized parties
Understanding which security objectives we're after is the first step in selecting an appropriate JOSE algorithm.