Digital signature on QSL card
- Introduction
In recent years, more and more stations have stopped sending paper QSL cards and instead use electronic or online log services. We realized that online log services are overly dependent on certain centralized websites and cannot fully showcase the individual characteristics of a station, making them unable to completely replace paper QSL cards.
Furthermore, a digitally signed QSL card without a physical signature is very easy to forge and cannot effectively prove the authenticity of communication. This article proposes a feasible digital signing scheme that allows for the digital signing of information on QSL cards while maintaining the functionality and personalization of electronic QSL cards.
- Scope
This paper defines a method for digitally signing digital QSL cards. However, this paper does not specify requirements for the distribution, trust, and revocation processes of public keys.
- Requirements
The digital signature proposed in this article meets the following requirements:
i. Digital signatures can be easily identified and verified, and do not rely on centralized third-party services.
ii. The digital signature has a significant impact on the design and aesthetics of the QSL card.
iii. The receiving party's operations to convert the received QSL card, such as formatting changes, do not affect its validity.
iv. The receiving party can print QSL cards containing a digital signature, and these printed cards can be independently verified.
- Reference documents for compliance
GB/T 1.1-2020, Guidelines for Standardization Work – Part 1: Structure and Drafting Rules for Standardization Documents.
In this article, the word "..." in bold is:(Do not)”、“(Do not)”、“Available、No need to”、“(Not) able to”、“(Not) PossibleThe use of "符合" is consistent with the definition in Appendix C of GB/T 1.1-2020, "Guidance on Standardization Work, Part 1: Structure and Drafting Rules for Standardization Documents."
- Definition
5.1 Basic Definitions
- Bytes A symbol consisting of 8 binary digits
- Signature payload The meaningful parts within the signed data.
- Signed data Input for digital signature algorithm
- Signature A file consisting of sections such as the header, signature algorithm description, and digital signature.
5.2 SSH Messages
This document repeatedly describes the SSH message structure. The types used in this context are:
ssh-string The length of a string represented in four bytes with big-endian byte order, and the corresponding byte sequence specified by that length, may contain Unicode NULL characters. The string does not contain any extraneous Unicode NULL characters.
uint32 A 32-bit unsigned integer represented in big-endian format, using four bytes.
byte[N] N bytes, no other information
varint Variable-length numbers, where the most significant bit indicates whether the number ends with that digit (1 means no, 0 means yes). For example, 150 would be represented as:10010110 00000001, convert to hexadecimal96 01Note: This type is not an SSH message definition.
Specific implementation
6.1. Selection of Digital Signature Algorithms
In this design, we will use SSH key pairs to digitally sign the information on the QSL card. This is because the signed messages using SSH are smaller and easier to display on the QSL card compared to PGP-signed messages.
Regarding the specific algorithm selection, we used the Ed25519 elliptic curve cryptography, because the public key and signature size of Ed25519 are both small enough to be easily embedded in QSL cards.
The signature does not include the information being signed.
6.2 Digital Signature Payload ADIF
The digital signature's payload consists of a single ADIF file, which can be uniquely constructed from the information displayed on the QSL card.
6.2.1 Constructing an ADIF file
The information encoded with a digital signature is formatted in ADIF, which has human-readable characteristics that allow it to be easily constructed. Furthermore, since the digital signature does not contain the information being signed, the length of the signed information does not affect the length of the signature.
The following information willIn sequenceIncluded in the ADIF data:
- QSO_DATE
- TIME_ON
- BAND
- CALL
- MODE
- STATION_CALLSIGN
- OPERATOR
Among them, QSO_DATEFor dates expressed in 8 digits (year, month, day) in Coordinated Universal Time (UTC). TIME_ONFor times expressed in 6 digits (hours, minutes, seconds) as Coordinated Universal Time (UTC), the time should be indicated, regardless of whether the corresponding second is printed on the QSL card.Cut offTo the end of the minute (effectively resetting the seconds to zero).
All of the above.ShouldUse uppercase letters. If the QSL card does not specify the operator, thenOPERATORWithout any modificationsSTATION_CALLSIGN.
For example, the following QSL card:
To BB0BBB / DE B4/BG6TOE
Date Time (BJT) / Freq / Mode / RST
2023-01-01 02:00:59 / 14.245 MHz / USB / 59 59
[x]PSE [ ]TNX QSL
73!
Its ADIF conversion results in:
<QSO Date: 8>20221231<TIME_ON: 6>180000<Band: 3>20M<CALL: 6>BB0BBB<MODE: 3>USB<STATION CALL SIGN: 9>B4/BG6TOE<OPERATOR: 6>BG6TOE<EOR>
This documentxxdDump to:
00000000: 3c51 534f 5f44 4154 453a 383e 3230 3232 <QSO Date: 8>2022
00000010: 3132 3331 3c54 494d 455f 4f4e 3a36 3e31 "1231"<TIME_ON: 6>1
00000020: 3830 3030 303c 4241 4e44 3a33 3e32 304d 80000<Band: 3>20M
00000030: 3c43 414c 4c3a 363e 4242 3042 4242 3c4d <CALL: 6>BB0BBB<M
00000040: 4f44 453a 333e 5553 423c 5354 4154 494f ODE:3>USB<STATIO
00000050: 4e5f 4341 4c4c 5349 474e 3a39 3e42 342f N_CALLSIGN:9>B4/
00000060: 4247 3654 4f45 3c4f 5045 5241 544f 523a BG6TOE<OPERATOR:
00000070: 363e 4247 3654 4f45 3c45 4f52 3e 6>BG6TOE<EOR>
Please note: at the end of the articleShould notAny extraneous characters (including newlines, spaces, tabs, etc.)<EOR>The string does not contain any characters.
6.2.2 Constructing ADIF information containing multiple QSOs
If a QSL card contains multiple QSOs, then the corresponding ADIF file will contain…ShouldFollowing the chronological order specified by Telelink, directly concatenate the ADIF data from each QSO, as indicated at the end of the document.Should notRemove any extraneous characters (including line breaks, spaces, tabs, etc.), i.e., those present after the last QSO.<EOR>It does not contain any characters.
6.3 Signature Data
6.3.1 Presentation Method
Signature dataOkay.Displayed directly on the QSL card after being encoded using Base64. Signature data represented in text format.SuitableUse fixed-width font for layout. The font used is:ShouldCapable of distinguishingi、l、1, O、o、0, 5、SWaiting for the encoding characters used by Base64.
Signature dataOkay.Displayed directly on the QSL card after being encoded using Base32. Signature data represented in text format.SuitableUse fixed-width font for layout.
Signature dataSuitableThe signature data is encoded using Base45 and included within the QR code.ShouldFor standalone QR codes. This QR codeAvailableUse colors other than black and white, butShouldUse a light-colored area as the background for the QR code and a dark color for the foreground of the QR code.
To ensure a high success rate in QR code recognition, use QR codes as the carrier for the signature data.Not recommendedUsing encodings other than Base45.
6.3.2 Binary Signature Data Format
The binary signature consists of an SSH signature structure, with the following format:
byte[6] MAGIC_PREAMBLE
uint32 SIG_VERSION
ssh-string publickey
ssh-string namespace
ssh-string reserved
ssh-string hash_algorithm
ssh-string signature
Among them:MAGIC_PREAMBLEForSSHSIG, SIG_VERSIONFor 1.
publickeyThis is the public key for the serialized signature key.
namespaceShouldForadif-qslv1.
reservedShouldEmpty.
hash_algorithmShouldForsha512(In other words, always use SHA512 to sign the data.)
signatureFor signing the SSH message, use:ssh-ed25519Algorithm.
6.3.3 Simplified signatures
To make the signature content more easily displayed,Okay.Simplify the signature content. The simplified signature only contains the header and ED25519 signature data. The header is fixed as:DQSLV1followed by a 64-byte ED25519 signatureX OR Y。When the receiver receives a message that starts withDQSLV1When retrieving signature data,ShouldValidate it against the standard signature format.
6.3.4 Signed Content
The actual content that was signed was:
byte[6] MAGIC_PREAMBLE
ssh-string namespace
ssh-string reserved
ssh-string hash_algorithm
ssh-string H(message)
Among them:MAGIC_PREAMBLEForSSHSIG, SIG_VERSIONFor 1.
publickeyShouldThis is the public key for the serialized signature key.namespaceShouldForadif-qslv1.
reservedShouldEmpty.
hash_algorithmShouldForsha512(In other words, always use SHA512 to sign the data.)
message4.2 The ADIF file described in Section 4.2, H(message)Its fingerprint under the SHA-512 algorithm.
After encoding this content using the SSH Message format, use the Ed25519 private key andssh-ed25519Obtain the signature as described in section 4.3.1.signatureFields.
- Add original QSO data
Previously recorded QSOs can be supplemented with original QSO data to facilitate direct recognition and validation by machines. The original QSO data consists of a concise representation of minimal QSO metadata, including the following fields: communication time, communication band, communication mode, receiving station call sign, transmitting station call sign, and OP.
The format is:
byte[6] MAGIC_PREAMBLE
varint call
varint station_callsign
varint operator
ssh-string data
Among these, call, station\_callsign, and operator are represented as 37-base numbers (see table below):
+---------++----+----++----+----+
|Char|Num ||Char|Num ||Char|Num |
+---------++----+----++----+----+
| 0 | 0 || C | 12 || O | 24 |
| 1 | 1 || D | 13 || P | 25 |
| 2 | 2 || E | 14 || Q | 26 |
| 3 | 3 || F | 15 || R | 27 |
| 4 | 4 || G | 16 || S | 28 |
| 5 | 5 || H | 17 || T | 29 |
| 6 | 6 || I | 18 || U | 30 |
| 7 | 7 || J | 19 || V | 31 |
| 8 | 8 || K | 20 || W | 32 |
| 9 | 9 || L | 21 || X | 33 |
| A | 10 || M | 22 || Y | 34 |
| B | 11 || N | 23 || Z | 35 |
| / | 36 |+----+----++----+----+
Such asB1CRAIndicates that it is11 * 37^4 + 1 * 37^3 + 12 * 37^2 + 27 * 37 + 10 = 20683861
In this case, "data" is a string formed by concatenating multiple minimal QSOs, and its format is:
varint QSO Timestamp
varint Band
byte[8] Mode
Among these, the QSO Timestamp represents the number of seconds since January 1, 1970, in Coordinated Universal Time (BJT), with precision down to the minute. The Band represents the lower end of the frequency range for a given band, expressed in kilohertz, such as 20 meters being represented as 14000. The Mode is a string representing the mode, using no more than 8 bytes.\0Complete.
- Example
Assume ST4TION Using a radio C3SHI With TE5T On January 1, 2023, at 10:05:30 Beijing time, a successful communication was established using MFSK modulation on the 20-meter band. The current status is:ST4TIONPlease sign the following QSL card with your own name:
TO TE5T
DE C3SHI OP STATION
Date Time (SSH) / Freq / Mode / RST
2023-01-01 10:00 / 14.074 MHz / MFSK / 59 59
[x]PSE [ ]TNX QSL
VY TU! 73
ST4TIONThe private key is:
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACADTnJZ6blw4CsqVoxzv9iWVVl0ycM8Neqb9QvTyvKqCAAAAJiuWf0orln9
KAAAAAtzc2gtZWQyNTUxOQAAACADTnJZ6blw4CsqVoxzv9iWVVl0ycM8Neqb9QvTyvKqCA
AAAEDgyhqzLTK6rmVqjfvHpvHPYJzdeVuDhRo93XO98jDl1QNOclnpuXDgKypWjHO/2JZV
WXTJwzw16pv1C9PK8qoIAAAAFW1hdHN1QEJHNlRPRS1Ob3RlYm9vaw==
-----END OPENSSH PRIVATE KEY-----
Its public key is:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIANOclnpuXDgKypWjHO/2JZVWXTJwzw16pv1C9PK8qoI
In this case, the ADIF data (with a valid signature) would look like this:
<QSO Date: 8>20230101<TIME_ON: 6>020500<Band: 3>20M<Call: 4>TE5T<MODE: 4>MFSK<STATION CALL SIGN: 5>C3SHI<OPERATOR: 7>ST4TION<EOR>
Please note:
- The Beijing time on the card should be converted to Coordinated Universal Time (ADIF).
- The seconds generated in the resulting ADIF file are unconditionally truncated to 0.
- The bandwidth is derived from 14.074, resulting in a value of 20M.
- RST is not included in ADIF.
This ADIF fileSHA512Fingerprint:
5d10 5c01 843a 14ad 9852 5f40 f9e9 36d5
0e00 56b0 d98b a04f 6d1d d337 efb8 11bb
f397 52d3 6233 6b64 ab8f 430f cf6b e95d
bfb4 39b9 26c8 fb39 9cbf 414a b386 a1b4
The constructed signed data looks like this:
00000000: 5353 4853 4947 0000 000a 6164 6966 2d71 SSHSIG....adif-q
00000010: 736c 7631 0000 0000 0000 0006 7368 6135 slv1........sha5
00000020: 3132 0000 0040 5d10 5c01 843a 14ad 9852 @...].\..:...R
00000030: 5f40 f9e9 36d5 0e00 56b0 d98b a04f 6d1d _@..6...V....Om.
00000040: d337 efb8 11bb f397 52d3 6233 6b64 ab8f .7......R.b3kd..
00000050: 430f cf6b e95d bfb4 39b9 26c8 fb39 9cbf C..k.]..9.&..9..
00000060: 414a b386 a1b4 AJ....
Use the private keys mentioned above andssh-ed25519Signatures can be submitted in the following ways:
00000000: 0000 0053 0000 000b 7373 682d 6564 3235 ...S....ssh-ed25
00000010: 3531 3900 0000 4082 84f9 edcb 8ef8 6cdf 519...@.......l.
00000020: 5bee c347 6762 84ea ce4b 4644 6429 6900 [..Ggb...KFDd)i.
00000030: 4139 6e79 9bbd f74c 2b94 0e53 541e 4dfa A9ny...L+..ST.M.
00000040: 94db 704a 9b77 aad1 4dcd 2e5d 6b3f 30c6 ..pJ.w..M..]k?0.
00000050: 44c6 7e84 ca4d 07 D.~..M.
Signature:
00000000: 5353 4853 4947 0000 0001 0000 0033 0000 SSHSIG.......3..
00000010: 000b 7373 682d 6564 3235 3531 3900 0000 ..ssh-ed25519...
00000020: 2003 4e72 59e9 b970 e02b 2a56 8c73 bfd8 .NrY..p.+*V.s..
00000030: 9655 5974 c9c3 3c35 ea9b f50b d3ca f2aa .UYt..<5........
00000040: 0800 0000 0a61 6469 662d 7173 6c76 3100 .....adif-qslv1.
00000050: 0000 0000 0000 0673 6861 3531 3200 0000 .......sha512...
00000060: 5300 0000 0b73 7368 2d65 6432 3535 3139 S....ssh-ed25519
00000070: 0000 0040 8284 f9ed cb8e f86c df5b eec3 ...@.......l.[..
00000080: 4767 6284 eace 4b46 4464 2969 0041 396e Ggb...KFDd)i.A9n
00000090: 799b bdf7 4c2b 940e 5354 1e4d fa94 db70 y...L+..ST.M...p
000000a0: 4a9b 77aa d14d cd2e 5d6b 3f30 c644 c67e J.w..M..]k?0.D.~
000000b0: 84ca 4d07 ..M.
Simplified signature:
00000000: 4451 534c 5631 8284 f9ed cb8e f86c df5b DQSLV1.......l.[
00000010: eec3 4767 6284 eace 4b46 4464 2969 0041 ..Ggb...KFDd)i.A
00000020: 396e 799b bdf7 4c2b 940e 5354 1e4d fa94 9ny...L+..ST.M..
00000030: db70 4a9b 77aa d14d cd2e 5d6b 3f30 c644 .pJ.w..M..]k?0.D
00000040: c67e 84ca 4d07 .~..M.
Base64 encoded signature:
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgA05yWem5cOArKlaMc7/YllVZdMnDPDXqm/UL08ryqggAAAAKYWRpZi1xc2x2MQAAAAAAAAAGc2hhNTEyAAAAUwAAAAtzc2gtZWQyNTUxOQAA
AECChPnty474bN9b7sNHZ2KE6s5LRkRkKWkAQTlueZu990wrlA5TVB5N+pTbcEqbd6rRTc0uXWs/
MMZExn6Eyk0H
Concise Base64 encoded signature:
RFFTTFYxgoT57cuO+GzfW+7DR2dihOrOS0ZEZClpAEE5bnmbvfdMK5QOU1QeTfqU23BKm3eq0U3N
Ll1rPzDGRMZ+hMpNBw==
The Base45 encoded signature:
1OAK69*B9000100000610000B00ZQET7D CSF6RW6C97000524C-9MGB.JNCFS%F50YHHBOA0J+DB MPNR7TTT1:U%YQMUUN010002E1AVCC-CIFE1WDY86000000000V 0 8DRW6KE60008MA0006K1OQEBX50UCVW61A6000J10MMG QV0XPBIVTASD8U919KKCZUTAN93T8QA5K10WB7 GFV0OES9CWI2OAH$3NUVGXRJJ9Y5FVKQB.PK BL:7-2P94PJZG9X9
Simplified Base45 encoding for signatures:
TS8*NAF+AMMG QV0XPBIVTASD8U919KKCZUTAN93T8QA5K10WB7 GFV0OES9CWI2OAH$3NUVGXRJJ9Y5FVKQB.PK BL:7-2P94PJZG9X9
- Informational reference document
RFC4634 U.S. Secure Hash Algorithms (SHA and HMAC-SHA)
RFC4648 Base16, Base32, and Base64 data encodings
RFC8709 Ed25519 and Ed448 Public Key Algorithms for the Secure Shell (SSH) Protocol
RFC9285 Base45 Data Encoding
ADIF Amateur Data Interchange Format (ADIF) Specification