Skip to content

Latest commit

 

History

History
388 lines (340 loc) · 20.5 KB

05-Test-Vectors.md

File metadata and controls

388 lines (340 loc) · 20.5 KB

Test Vectors

To better illustrate the concept and verify its implementation, scenarios with test vectors are described here.

In the following, Alice has the user password password123456 as well as a Kyber and an RSA key pair:

  • Kyber
Kyber Public Key
-----BEGIN KYBER PUBLIC KEY-----
MIIFQzCBlwYJKoZIhvcNAQMBMIGJAkEA/KaCzo4Syrom78z3EQ5SbbB4sF7ey80e
tKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9xD7nN1kuFwJAZ4Rxsnqc
9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0N
ogpsQW5QvnlMpAICBKADggSlAAKCBKD140MJwcgwcKrKV28DeXvN14TBVA4/gFQ4
VXoswE/UvL1UlZudxJg1w8n/OsimR4nlwoVdOSwAZSGOemvjyH/cfGQvC64nhwm0
WJojIRzVaF9qwrSBEbjLi8wSE4wblAK41baYlnCrd3TOJWz0mMdGeqKO+Tgv0hiL
533gl07cea/agXMjk84HO8FLGzRDGVcrAHm9ZnSJkII3cx3/NXfNpYX8aE+pcoHI
sCAVmme+2iOVk3grQR9CZaVg3EGV9qnEaxNKlHDlFRsSm2JpMS2OFCnMm8oC6VVZ
VjVJm7v9iinxO7fZlDzLg2LWwzdZpsyrVXI99GENI2f7NLdNR874tE9OBGC5Oytx
uUHvAkkChnuOhTi24z+ZWsMqUKJnBZs6J19gKpXtEhcGJT5SYZAGqAQZ5QreqnrT
hj1h6LXZIm5jMJJGLIuzHFLiAnYr2JpeQyxgYEfMTGkgF1sxImLBHFAfqpgAvInF
97cwU0TO+BD22kZwAK4rnLnxR3XqQLOmUEETQj67F02PaDJbLBMUGxp44a0ziCGY
8bRStc0h2oZhR3s2MSSA/K3SxHda6AFV4sRMuweLMcmYc4Xl+xHBNIPY9iuEOzMk
h4044TkDSScj+CMXlLx93M1dLFAWAq56uhYHbJ5s95/lF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l0M4F3f1nX
hL9sb6xjMy9Vr/UiGy2CfVolZO/rvcuYVxWR5hIovJnZEpuTawh9JxOj2qjRPeof
eb8ld0I5aVvMLkFRGfqjcUIKXRj9FbK+cKKLLzYZQuSjJQsepdw7lojInCOFA2Es
WsAJgVzIB4Ihrfj/AfAvb9XbYOdEcBOmQQ==
-----END KYBER PRIVATE KEY-----
  • RSA
RSA Public Key
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuc02QTELwzsPWfXKyEgr
xqQgm170JR3l0Au8QioIz22/hNykyFQtpV7/Je+CjBfA5ApVwEE+am7YYpYFvO/o
xP/PT/zwkHCz9nSSYrZTna8wwLu9bggWuxSU2taysR7f4RlRgctBwwDs2553h9Xd
owAVOqVzfDhr6j8qsAhS8xV0/WnIHW87L52VUHfkNLg2RLIsqplcB2TChgCOHNZB
+WUtA92mmV0s3o/7AJjeZmiCnirYdrFP9n0NtHE0fycngVKQhgJzf3LrT7PDO/wu
Q2h2W7wXfLCOS/TSNx/MbGyU+BGk3QDf3PeMYhMfgUIwBmo1OosXnz+u2AqqCW5k
UEJ2UiO8Mk4o8BtU37twf4X0idUO2Hq9KmuXbZ3UWDBkhKfuP8ZWOfI3fdoHgBMb
QHM3w4qu1GNFy22wCtMGaiDIlnHB4XF+0pCcEvj7b1cXylcA0Qr0dkGkPENVP50N
9+8kuCKZrpU8135ymH+rO/En5+BpAeakXy8YXNBHli2biS9b7yqzz/N3W84ncHuz
6s+lcbGQzWoBZylQvYbl+YB65K3uuTDMPFbX/pQ0lwltwwjbpu8vmE4UKN+o7614
DhyqRanCk1jkDxoGppr/v4AK0/6IfOQiQdkWdFc6IGvG41bBquV4lBX5Br0Zgpqf
FopIXsQUej/snkw1oPqhsJ0CAwEAAQ==
-----END PUBLIC KEY-----
RSA Private Key
-----BEGIN PRIVATE KEY-----
MIIJRAIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQC5zTZBM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rAPM
7P1PikyLIfxhJcGYGfeTux88KNaFH13eAqJoFrIzmbM7UCep4jIjsWDUqFbwFKgo
NwvhS6Wcgfv5nC2tIX92ocnuKJy7qtYlj9dM0rDFg/WWVsq1DXgjjxMYi5UJvH5n
D7SJkvqxU8V2Eu0LYxPDlFAgGd9LVQKWors88BQ7Q1Hy9PfNYMfheQu4ZxR7lLet
GQo72EDT9XLP0VHHcMs6Z2rs4st91qBbvKFpbDjVQ9tgV1tA5vuYB5wdMZsyVSWN
yNKNUSnT8LLolDGfNSc/tPN4tRjEY4pdN29QYBoNAoIBAQC0EjXQ0GKZGzGvHz17
xHMiwi4bIub9wFl9BqxdAQV1fBgebXcZHtsqonjy5JDh2M+CuYl8NJrzyVCAYRbw
2KRsUaU15hAFq+oT2sM7iIPpsM32MzJm7Y4iVP32ewNDrjJMxzqBzRWxFVUOoXeZ
wadOdg+xpKPucL+7h/Rxpu8BXDbyCJ6xTe2oObIV3OPVJAf6Nd2MkgVXFoCs440d
chHH3Lm2MVAuxTaEWYzJe33FbS3eFBEZL7RAik6hMmTM4z8HEdANjl7PMQ7SoXgq
sffZIH3yC5huf26l0HX65ELNVXq+7emkaE1o4RZWdufQoQUTQZ1JVY/5cAmDlQZT
lE+RAoIBAQC6TUKJA4oGf9uvgzUM8BcU/xERLSSSyjuDRJy9nL1IFhRp8WLzTMwV
ykFU1WbWHAOfN0fdb0OHd7LuKhyfvjrqn+6HqAuzP01qifk3UH49EX2A8gqOFD8/
UTO1nKWiYzojIViAuOdeJ1LcsZ90FylhPUJ9tKgD//hhB0D4ppVLHHQxJNSOHqqG
z5pBeUnq6wlvrTr4zIn7PsQgTCqGmd1PT/ccsT85wrfufEHEbQD3XewBzsZLISQz
xLm1ELcWfrLCAZAIiNK1yG4YUmyFOetKAUxgk/9XsM6DFiPcM692eFyAcoDy6Trs
HTwMtMu9FJxg9m7T+NioXb6vHMrJ+KeO
-----END PRIVATE KEY-----

Alice creates key material for a board

Alice creates key material for a new board, which she initially encrypts only for herself.

  1. Alice generates a board key (32 random bytes):
Source Code
board_key = random_bytes(32)

print('board_key:', base64.b64encode(board_key))
board_key: pKua3nhSlRKnTjtOwbnz3D/wmqagNe6A1TC2NhGhOCs=
  1. Alice creates and encrypts an initial secret with Kyber, which later serves as KDF input:
Source Code
kyber_kem_result        = Kyber.encapsulate(kyber_private_key, kyber_public_key)
kdf_input1              = kyber_kem_result.secret
encapsulated_kdf_input1 = kyber_kem_result.encapsulated_secret

print('kdf_input1:             ', kdf_input1)
print('encapsulated_kdf_input1:', encapsulated_kdf_input1)
kdf_input1:              66dWmchrfIuHMqMDMzw1CpPsBj2SU+zlwfQRv5HSJus=
encapsulated_kdf_input1: MIIE4zCBlwYJKoZIhvcNAQMBMIGJAkEA/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0I
                         mbzRMqzVDZkVG9xD7nN1kuFwJAZ4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBi
                         NU0NogpsQW5QvnlMpAICBEADggRFAAKCBEDxohEP3AcCbSzZWNhCywBx29wFklldizylVeSxm1PxTfr8+RcJ0R1n38IEIT
                         /smVugHbENQOfbZ2E8i+re43GSSoEWs1N1Z9HNFh+UcmQedpsd8sDNjHObezQ3JUzFYcbkOFiZCrFyrgJ73+OkpiIRHAbH
                         64+6Y83JYVB6ajfuP14OHYQcZjGJUklXwUaDTEeENVK8K26GPRdJ6E/17MOc3Sgq+CvgrpNRMxquuA0h8GgUXCe+K3APuv
                         D37k2+tUQfIugr/JnkiwS0k0JLSyurqffEWX37zeKGpjvNZubcRzCPa59x+SHeINGGHkV6I0tquFIr5JznXLXguBbWJRdS
                         M1u9Wv66q9YsGV25KDTyjCYmYYRFMagl0qg7+R8sQXNmj0MmfZ8oKGrOpkT8xPcAT2qHy7CFqfQkrN6AsOu2DSb7TOHrzy
                         03LXzvgPg1ROBLZK4PbcGrvDOaq+pHdRxzpxQjxyUKZe0jy2L5J2ImEEJZ8zIV2msqqK/YwOyMDVGpF7GwLrs7oKb1uOrZ
                         +y9eLKV8NLdHkfSgheujFqc/g67WvGjQGOZx0NPgDt+qe/2k13Qlpql5K4D8a/0uWrWBUCt1iUGdoYiHLxkz7EY2c/C05t
                         mXYgSCV9/4YxRGXwfHesRRDqRwxopcFR0trb4PNxE/bCfq52MWcz1U2DFVEcHkZYKBpuVrwcuDwWNpJyq5/38yo/8kcBbT
                         nO0rQBHAoXthS4b3eJr54OIix4IUgNxtiY1wRmbLZn3uDyvHaWVceitIcQFhh9GZRiMuoqQgCFpfaHPp41ULS+RFh13Si6
                         luwEaxTyCskfkA56qjNmC569X2vsr4n0TMY9kQNPSMDfbX0t5bJztyL9Ts/DzoKFwb/2M1a2qBxFvIYDICuvT1z+kR9r5M
                         EWIxbZW4U4UbFeDMSWm14kmBZIYuJ+1TTi0x3ev8+vwfFscvsx+A0WAbvRX5+jxPCVvoUIwRdbV47ORjxkeGeWmLjMaxVz
                         3yPtYUvmJUH+HrNCDahtD07mYabyxtRa5un1L38nM4Jp0N0+jQ4CWFIdk28tADqcMo/p7lfkm2EC8wflWeJwC0sdsoEdR9
                         o7D7aWdJL1kT2j2z6T4oqh9ddKTJLIXgvKQgSCMGicloKYHQbsOoJoBFQ/KhXKx8pZbYJOc/qf3iK6MfCkQuvYyca2z5Bk
                         0P3HcfpGOAEwhdA0Yn/6rIhMR9Wnmx8FjPO64gD234ghuMU5PzftIUMdWMeSpdbkjwP4W+5JuZrhzTFdUpOzJVkVVjhQrQ
                         QF3Da8G2tpw28gimn7xm8I+wPkPFVn3/0Rnsr3rgA64Z6/pSlcXAXSkMVDN6+Ip3kE4InLQ0cN99HJmbUrO6Rjnf0pBDzW
                         sLW9wgNtgewpAz7tmiRxftWmwpqeh0c88v+rRF+IbjALTUEHUyPwRsTYc5fOxUYN6z2J3FmqImWg==
  1. Alice creates and encrypts a second secret using RSA, which later serves as KDF input:
Source Code
rsa_kem_result          = RSA.encapsulate(rsa_private_key, rsa_public_key)
kdf_input2              = rsa_kem_result.secret
encapsulated_kdf_input2 = rsa_kem_result.encapsulated_secret

print('kdf_input2:             ', kdf_input2)
print('encapsulated_kdf_input2:', encapsulated_kdf_input2)
kdf_input2:              R5do1jbeqyptBbGafLz3eMs6QpdLQYnMhxEUhswqtvft1DAKFn0mYk0nXvO7/ltUxM9IjXGb0aJrU89I26dZfYOQ8drZiF
                         gspJMwpHjy6GMDMhLb2Yox4i3scrkCZS+ap8Zk2sTk1/VdERxZdbCKaVI+K0LAeI43lFkYeoMpir9MkNArSI/f2zNWW5BC
                         qmXZcZJUKcQWfvwGv1ovg0qs3ifN6bX10H8MvgELBudEq3DqGBgiH7arFZeT2/m1Fubq48tMS4tKLs1HzSOQP4OVhjkav6
                         fqsKMFdKd+5wecKcgGDCvwBkLCKWR8T2Ie0sNs7XJ4xeTUFGcPwZFhmJ7og8Xb+HaiQ+DZWxUuBjqs7h+Pp85V/T6SIMkZ
                         pFBw1DCSQlIhfZDCaAK0wM2zDLWHWveM+xoe9KLQaxr2GHAD6N02uJ2UvwY+ZSlUvoulYC6sGQLtAmN7M1D5x0GqPIBr/0
                         3btjD4ECa7vz5+qg4CgMbS545oLVI+oYpw43KoGR1Qhjt0VfmBoJuf2YrI4hr85LdBUCmewcDmSz78Es+YLcIH7+YspXNA
                         XwV2pmip2hf7YuKbXIq4nx9TC5BzgO1IgSMO6agigZt97xzcvJ8Nw1SbD45SSdCUnnE7V1ZywR/H7EKGKKi+60fvwGB7IK
                         0Q9oTrXkyni33MQNweO27KYqs=
encapsulated_kdf_input2: Bu4B4ptBfjKLWWtMH1+WgENwclZNlz0uJs3TKgyxZop2HFo+wz+NBaNijwKixlLuF6H5YR22raAjjQR8qveGfRKHvsv8ld
                         sEUg5cNdbJ413GZrAwGio5LID4z3sCRbKpAThQg1ho+qqiLpX08jfup0Rk2ib7MVJCi8Ax7U6ZjZtM3dBr0IIWWlSWarzy
                         yP9e83PGguaqsTqUTc/lKenbcenuNNzhH/o3Aaw3/ywv7hsJQgWbrO/CwjIYJVNtk9s6Y0AfVLP6z9BMruSsO+zRRb93HO
                         cFNvdYbgaiYw/mqtbC1mSuzFsFJKrFwPzu8J+AGP28Axdxpe/wlDvYPio+mnoP3YmaEOE34BeEVRIHDDUHg5s92lajTqEs
                         7+19ykLIdPMgA3me+p305bxWXX605UoXLr3C0YMGvdhcE0S4/cOjp0cLMM18uHxfln5eeKcNkiqZB4EltfDTsF6z/VTLYc
                         SfyP0hkSYR1OJ9zFdjbBXwRQs3yDxLb/4msQtH6xeTmqwiO2jd0Wzh6hjilUU0/aDzpMa0ZE+mhtLCDUtvQa/qUYeFStEP
                         fdm6eulNRSCWVbutr3+a3iG5bcI5DCQ21IeHRJtAqLRZhcY/zYpNvlEQDQ7IZ0x9aUTEmmLJ71kNO+2Yhkzfmrl9dDK8Nx
                         0xcSqsZO6T4xSJormtfMZnjCc=
  1. Alice encrypts the board key
Source Code
key_encryption_key  = hkdf(kdf_input1 || kdf_input2)
encrypted_board_key = aes256kw.encrypt(board_key, key_encryption_key)

print('key_encryption_key: ', key_encryption_key)
print('encrypted_board_key:', encrypted_board_key)
key_encryption_key:  pTvOc7Sj9Hqi9KyVvzdjqngU+sQJZOSW4/0qCJJYaOY=
encrypted_board_key: 5+v3LhNeFW7yGsJzaSJKAhRBnFkw2bB8nKKnK9rr3gaa3jMqfghb9Q==

Alice opens a board she previously created

The steps in which Alice obtains data from the server are omitted here for simplicity.

  1. Alice already has the encrypted key material
encrypted_board_key:     5+v3LhNeFW7yGsJzaSJKAhRBnFkw2bB8nKKnK9rr3gaa3jMqfghb9Q==
encapsulated_kdf_input1: MIIE4zCBlwYJKoZIhvcNAQMBMIGJAkEA/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0I
                         mbzRMqzVDZkVG9xD7nN1kuFwJAZ4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBi
                         NU0NogpsQW5QvnlMpAICBEADggRFAAKCBEDxohEP3AcCbSzZWNhCywBx29wFklldizylVeSxm1PxTfr8+RcJ0R1n38IEIT
                         /smVugHbENQOfbZ2E8i+re43GSSoEWs1N1Z9HNFh+UcmQedpsd8sDNjHObezQ3JUzFYcbkOFiZCrFyrgJ73+OkpiIRHAbH
                         64+6Y83JYVB6ajfuP14OHYQcZjGJUklXwUaDTEeENVK8K26GPRdJ6E/17MOc3Sgq+CvgrpNRMxquuA0h8GgUXCe+K3APuv
                         D37k2+tUQfIugr/JnkiwS0k0JLSyurqffEWX37zeKGpjvNZubcRzCPa59x+SHeINGGHkV6I0tquFIr5JznXLXguBbWJRdS
                         M1u9Wv66q9YsGV25KDTyjCYmYYRFMagl0qg7+R8sQXNmj0MmfZ8oKGrOpkT8xPcAT2qHy7CFqfQkrN6AsOu2DSb7TOHrzy
                         03LXzvgPg1ROBLZK4PbcGrvDOaq+pHdRxzpxQjxyUKZe0jy2L5J2ImEEJZ8zIV2msqqK/YwOyMDVGpF7GwLrs7oKb1uOrZ
                         +y9eLKV8NLdHkfSgheujFqc/g67WvGjQGOZx0NPgDt+qe/2k13Qlpql5K4D8a/0uWrWBUCt1iUGdoYiHLxkz7EY2c/C05t
                         mXYgSCV9/4YxRGXwfHesRRDqRwxopcFR0trb4PNxE/bCfq52MWcz1U2DFVEcHkZYKBpuVrwcuDwWNpJyq5/38yo/8kcBbT
                         nO0rQBHAoXthS4b3eJr54OIix4IUgNxtiY1wRmbLZn3uDyvHaWVceitIcQFhh9GZRiMuoqQgCFpfaHPp41ULS+RFh13Si6
                         luwEaxTyCskfkA56qjNmC569X2vsr4n0TMY9kQNPSMDfbX0t5bJztyL9Ts/DzoKFwb/2M1a2qBxFvIYDICuvT1z+kR9r5M
                         EWIxbZW4U4UbFeDMSWm14kmBZIYuJ+1TTi0x3ev8+vwfFscvsx+A0WAbvRX5+jxPCVvoUIwRdbV47ORjxkeGeWmLjMaxVz
                         3yPtYUvmJUH+HrNCDahtD07mYabyxtRa5un1L38nM4Jp0N0+jQ4CWFIdk28tADqcMo/p7lfkm2EC8wflWeJwC0sdsoEdR9
                         o7D7aWdJL1kT2j2z6T4oqh9ddKTJLIXgvKQgSCMGicloKYHQbsOoJoBFQ/KhXKx8pZbYJOc/qf3iK6MfCkQuvYyca2z5Bk
                         0P3HcfpGOAEwhdA0Yn/6rIhMR9Wnmx8FjPO64gD234ghuMU5PzftIUMdWMeSpdbkjwP4W+5JuZrhzTFdUpOzJVkVVjhQrQ
                         QF3Da8G2tpw28gimn7xm8I+wPkPFVn3/0Rnsr3rgA64Z6/pSlcXAXSkMVDN6+Ip3kE4InLQ0cN99HJmbUrO6Rjnf0pBDzW
                         sLW9wgNtgewpAz7tmiRxftWmwpqeh0c88v+rRF+IbjALTUEHUyPwRsTYc5fOxUYN6z2J3FmqImWg==
encapsulated_kdf_input2: Bu4B4ptBfjKLWWtMH1+WgENwclZNlz0uJs3TKgyxZop2HFo+wz+NBaNijwKixlLuF6H5YR22raAjjQR8qveGfRKHvsv8ld
                         sEUg5cNdbJ413GZrAwGio5LID4z3sCRbKpAThQg1ho+qqiLpX08jfup0Rk2ib7MVJCi8Ax7U6ZjZtM3dBr0IIWWlSWarzy
                         yP9e83PGguaqsTqUTc/lKenbcenuNNzhH/o3Aaw3/ywv7hsJQgWbrO/CwjIYJVNtk9s6Y0AfVLP6z9BMruSsO+zRRb93HO
                         cFNvdYbgaiYw/mqtbC1mSuzFsFJKrFwPzu8J+AGP28Axdxpe/wlDvYPio+mnoP3YmaEOE34BeEVRIHDDUHg5s92lajTqEs
                         7+19ykLIdPMgA3me+p305bxWXX605UoXLr3C0YMGvdhcE0S4/cOjp0cLMM18uHxfln5eeKcNkiqZB4EltfDTsF6z/VTLYc
                         SfyP0hkSYR1OJ9zFdjbBXwRQs3yDxLb/4msQtH6xeTmqwiO2jd0Wzh6hjilUU0/aDzpMa0ZE+mhtLCDUtvQa/qUYeFStEP
                         fdm6eulNRSCWVbutr3+a3iG5bcI5DCQ21IeHRJtAqLRZhcY/zYpNvlEQDQ7IZ0x9aUTEmmLJ71kNO+2Yhkzfmrl9dDK8Nx
                         0xcSqsZO6T4xSJormtfMZnjCc=
  1. Alice decrypts the first secret with Kyber, which later serves as KDF input:
Source Code
kdf_input1 = Kyber.decapsulate(encapsulated_kdf_input1, kyber_private_key, kyber_public_key)

print('kdf_input1:', kdf_input1)
kdf_input1: 66dWmchrfIuHMqMDMzw1CpPsBj2SU+zlwfQRv5HSJus=
  1. Alice decrypts the second secret with RSA, which later serves as KDF input:
Source Code
kdf_input2 = RSA.decapsulate(encapsulated_kdf_input2, rsa_private_key, rsa_public_key)

print('kdf_input2:', kdf_input2)
kdf_input2: R5do1jbeqyptBbGafLz3eMs6QpdLQYnMhxEUhswqtvft1DAKFn0mYk0nXvO7/ltUxM9IjXGb0aJrU89I26dZfYOQ8drZiFgspJMwpHjy6GM
            DMhLb2Yox4i3scrkCZS+ap8Zk2sTk1/VdERxZdbCKaVI+K0LAeI43lFkYeoMpir9MkNArSI/f2zNWW5BCqmXZcZJUKcQWfvwGv1ovg0qs3i
            fN6bX10H8MvgELBudEq3DqGBgiH7arFZeT2/m1Fubq48tMS4tKLs1HzSOQP4OVhjkav6fqsKMFdKd+5wecKcgGDCvwBkLCKWR8T2Ie0sNs7
            XJ4xeTUFGcPwZFhmJ7og8Xb+HaiQ+DZWxUuBjqs7h+Pp85V/T6SIMkZpFBw1DCSQlIhfZDCaAK0wM2zDLWHWveM+xoe9KLQaxr2GHAD6N02
            uJ2UvwY+ZSlUvoulYC6sGQLtAmN7M1D5x0GqPIBr/03btjD4ECa7vz5+qg4CgMbS545oLVI+oYpw43KoGR1Qhjt0VfmBoJuf2YrI4hr85Ld
            BUCmewcDmSz78Es+YLcIH7+YspXNAXwV2pmip2hf7YuKbXIq4nx9TC5BzgO1IgSMO6agigZt97xzcvJ8Nw1SbD45SSdCUnnE7V1ZywR/H7E
            KGKKi+60fvwGB7IK0Q9oTrXkyni33MQNweO27KYqs=
  1. Alice decrypts the board key:
Source Code
encryption_key = hkdf(kdf_input1 || kdf_input2)
board_key      = aes256kw.decrypt(encrypted_board_key, encryption_key)

print('encryption_key:', encryption_key)
print('board_key:     ', board_key)
encryption_key: pTvOc7Sj9Hqi9KyVvzdjqngU+sQJZOSW4/0qCJJYaOY=
board_key:      pKua3nhSlRKnTjtOwbnz3D/wmqagNe6A1TC2NhGhOCs=