Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting quantum-resistant keys and classical keys from a composite key. #474

Closed
maroueneboubakri opened this issue Aug 8, 2024 · 5 comments
Labels
question No code change required

Comments

@maroueneboubakri
Copy link

Hello,

Given a composite key, is there any way to programmatically extract quantum-resistant keys and classical keys from a composite key the same way we do for hybrid key using OQS_HYBRID_PKEY_PARAM_* ?

It seems that the provider can do it when parsing an input key or certificate.

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            25:ff:e5:2b:8e:9c:80:ff:33:40:92:9b:9a:45:9f:8c:bd:e8:c3:4a
        Signature Algorithm: mldsa65_rsa3072
        Issuer: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd
        Validity
            Not Before: Aug  8 16:15:53 2024 GMT
            Not After : Aug  8 16:15:53 2025 GMT
        Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd
        Subject Public Key Info:
            Public Key Algorithm: mldsa65_rsa3072
                mldsa65_rsa3072 composite public key:
                mldsa65 key material:
                    b6:e0:cf:96:67:91:68:83:cb:79:54:71:eb:10:46:
                    38:04:03:99:00:36:23:9b:be:87:ca:05:de:7f:4d:
                    8c:ef:49:cc:cb:ad:b5:4f:87:2b:9a:78:0b:9b:73:
                    a6:e3:2e:05:49:3e:5e:e1:48:28:87:9c:11:52:00:
                    46:cd:36:af:ff:bf:20:2a:d0:c8:be:ae:34:04:72:
                    a0:e8:4e:88:7a:c8:11:84:54:98:0e:a8:6a:f9:30:
                    a6:84:72:d7:05:78:2b:4b:38:9a:48:d1:87:3e:42:
                    76:03:da:d9:b8:86:97:aa:67:fb:37:af:e8:35:a9:
                    d9:96:ce:32:70:a8:d3:31:99:9c:c4:83:ef:0b:e6:
                    be:a3:7a:80:ed:e3:66:8f:28:8d:eb:8e:e9:2e:bc:
                    dc:99:01:da:dd:0a:8d:50:09:88:aa:d0:56:8f:eb:
                    fe:cf:0d:cf:4b:f1:90:41:90:99:62:0e:8e:96:86:
                    f9:9a:0b:be:61:4e:cf:85:15:de:36:7b:93:28:27:
                    4d:7d:77:68:ba:eb:d4:4d:1a:6e:b8:36:44:80:f1:
                    d3:1f:37:09:4f:d0:62:ee:82:fe:32:a4:8e:14:64:
                    e1:aa:9d:f1:97:23:76:ea:3f:60:75:07:39:42:fa:
                    c8:63:c0:d9:e5:63:c3:6c:4c:1f:fa:82:41:38:ca:
                    47:89:f9:76:92:8a:3a:c6:ff:77:d3:1a:a3:8c:43:
                    96:db:d3:4a:72:56:9b:ad:d8:10:8e:c1:4d:2c:4d:
                    e5:cd:30:71:b0:ca:36:51:da:a7:9d:b6:85:7f:5c:
                    c5:ae:45:21:c6:db:eb:f3:58:26:69:b0:0b:11:b5:
                    0c:22:e2:8f:0e:2b:9c:96:c0:8d:68:21:88:2b:56:
                    53:49:32:5e:ad:7b:a3:89:3f:90:60:18:7f:2c:85:
                    d5:e4:7a:2f:15:73:e7:c5:72:be:98:63:b9:ba:9c:
                    80:6a:59:69:7f:d6:a5:78:2f:20:6b:78:d6:cd:f5:
                    d0:47:93:07:38:42:0f:61:17:d3:ae:a2:5c:43:b9:
                    15:83:63:83:56:bf:bc:59:33:fd:f0:a2:f2:06:cc:
                    22:a2:6d:e7:0a:50:3e:30:25:9f:69:23:3c:49:8e:
                    be:6a:ce:09:8a:a4:a1:cc:cb:4b:bc:c0:ff:7c:35:
                    bf:81:12:81:30:4c:4c:3b:a2:4c:6d:03:cd:16:7b:
                    d6:7c:b2:19:55:36:0b:4b:c6:01:b5:18:d9:ce:b0:
                    fc:4e:18:6d:d2:22:37:2a:c9:9d:f6:30:fb:25:61:
                    e4:da:4e:59:48:c9:26:ec:ed:ec:84:f0:94:b5:89:
                    8c:fe:9e:82:e1:58:a2:03:04:91:ae:18:18:77:31:
                    ff:f4:8c:3e:02:b1:43:09:26:d9:da:2c:80:5e:7e:
                    27:e8:49:f0:84:2d:af:8b:48:76:58:9f:10:50:e1:
                    81:36:b8:29:bf:fd:d0:4d:f9:b0:fe:36:f5:b8:21:
                    04:4b:a0:0c:a7:90:f5:80:57:08:80:9c:41:53:f2:
                    83:9a:79:22:25:75:2d:64:f9:bf:89:6c:49:f1:45:
                    2f:37:42:8c:3a:ac:99:e1:e8:5c:51:91:df:22:f4:
                    77:24:af:7a:6b:f9:24:08:e1:a8:4e:b0:0c:b5:7f:
                    38:48:ae:cc:cd:2f:b9:14:cf:42:72:e8:13:20:68:
                    4d:79:ee:93:45:70:3a:6a:c7:56:82:81:bb:66:16:
                    59:33:23:68:ef:50:4b:7a:c5:5c:10:6c:f7:16:f1:
                    ed:17:9a:2d:a5:93:9d:24:3e:3e:6e:1c:a3:52:5d:
                    33:e7:8e:74:c4:28:c0:75:eb:0f:19:f4:79:dc:76:
                    c2:35:ad:26:c7:f2:ec:74:ef:cf:6f:af:39:ae:63:
                    c0:69:ec:4d:d3:1a:f5:51:05:09:ae:f9:3a:0c:eb:
                    c9:26:16:09:ec:6a:d8:86:90:a5:ae:dd:4b:4d:e9:
                    bc:f9:97:d7:5b:68:67:be:99:25:b5:2e:bf:a9:53:
                    bf:80:dd:52:24:74:07:a0:43:0e:9e:30:04:d4:10:
                    0b:bc:80:10:4f:c3:99:7b:94:c8:e5:0a:ad:d8:1f:
                    8d:28:7a:59:d4:fb:81:e9:31:2a:a2:27:39:c1:8a:
                    fa:d9:d2:31:c0:63:6c:6d:8a:99:99:1a:26:70:79:
                    8f:76:5d:90:2d:36:f1:0f:e7:1b:40:16:82:7e:7e:
                    c7:6b:e4:71:a0:6e:46:a6:88:c6:b7:25:0e:1e:bd:
                    07:cc:25:d4:55:63:86:e2:76:71:cd:2d:09:49:a9:
                    41:01:3d:d6:4f:0e:8b:66:24:c9:0e:c0:ad:c7:be:
                    80:ff:9d:45:78:8d:76:8c:6f:54:b6:19:f5:5c:dd:
                    ee:02:18:eb:61:43:d3:ea:06:28:44:ed:25:00:a1:
                    11:21:a9:06:38:0f:10:87:86:5c:ba:53:a2:73:b1:
                    48:bb:bf:34:b9:d3:4f:2b:5a:3c:6b:b4:99:de:70:
                    16:a5:9c:9a:ae:15:c0:5f:11:48:c8:56:78:06:98:
                    2c:65:d6:07:a3:08:d0:c5:53:2d:24:c3:b3:3f:7c:
                    14:72:73:43:3e:d3:7f:75:7e:b0:58:61:dd:02:e4:
                    05:08:5d:73:33:43:5f:ad:c5:4f:bb:0a:71:d1:a2:
                    d0:ba:3b:43:4a:8e:d4:34:16:22:23:f7:d4:8f:5d:
                    aa:e1:a1:bb:03:bd:9c:40:b3:1c:ad:50:c0:a8:56:
                    e1:7e:65:75:97:75:53:d7:11:08:1c:8a:c2:79:82:
                    be:6f:10:b3:75:af:59:14:87:5b:2d:bd:a2:14:4a:
                    6d:42:b5:62:29:2e:31:6b:f0:ab:59:16:03:14:d7:
                    ff:c2:00:cf:24:06:7d:30:a8:a4:15:4f:29:d5:a1:
                    86:5c:1a:5a:d0:a9:a0:23:26:1c:b7:b6:68:82:f2:
                    18:a4:cf:cf:d1:8e:12:82:b8:3a:7f:20:81:c6:1f:
                    19:48:74:4e:01:b0:d3:a8:28:58:33:51:d6:d0:ae:
                    17:33:23:d1:e5:da:60:af:1d:59:cf:59:2f:cc:7e:
                    2c:b3:bf:7a:71:91:02:74:18:7c:72:5f:49:ca:62:
                    0d:9d:98:8c:f1:cd:9e:1e:b9:cd:6d:44:58:0f:5c:
                    00:98:4c:44:81:00:71:cd:92:4f:57:ac:37:06:4c:
                    fd:69:79:11:f9:f5:1d:fe:e1:18:13:7f:05:74:99:
                    b9:7f:3f:c6:a5:e8:22:84:82:44:6b:78:c9:40:c6:
                    42:ea:8f:35:b9:3e:d5:4f:4f:22:86:f0:c8:2b:f4:
                    70:5a:0b:8b:31:67:43:98:10:1f:d8:29:c3:e5:6f:
                    99:9d:04:c9:5e:db:85:37:bf:54:2f:81:98:34:c5:
                    3b:86:19:5a:cc:b4:08:a7:58:39:eb:75:d9:87:38:
                    79:97:dd:77:66:7b:0b:7b:ea:fb:75:b8:36:e3:e3:
                    74:c4:22:9f:83:75:46:0f:89:07:a1:c2:66:6b:c0:
                    38:3c:82:46:bb:02:e3:77:e2:3b:c6:61:a7:b3:bf:
                    c4:dc:1d:0c:d1:2f:6b:d4:33:43:f5:30:02:55:ae:
                    80:b6:51:79:e0:31:3d:38:d1:82:76:c2:95:ca:02:
                    df:19:a1:0a:71:4e:d1:e6:72:f8:e2:0c:df:41:c8:
                    a4:a1:7d:cb:5c:58:65:a2:a6:f9:f6:2b:ec:7a:3f:
                    80:89:fc:b0:6f:f3:8c:6e:19:c9:ec:5e:f1:24:39:
                    34:80:73:a0:c5:86:52:fe:dc:63:cd:45:2e:5e:cb:
                    19:0f:df:1e:0a:f8:ee:c9:1b:c0:7c:c0:cf:90:dd:
                    c4:44:d3:30:fc:38:fe:f7:55:05:a6:8d:98:21:fb:
                    8e:eb:91:0b:fb:6b:9d:1c:42:4b:95:04:35:15:9f:
                    ac:de:a6:7d:fd:10:e9:46:68:a7:99:5a:49:82:79:
                    08:da:53:a4:4c:a6:76:70:37:1f:53:0a:58:89:8b:
                    9c:73:cc:a6:44:6c:08:86:2c:45:8d:9d:a8:b2:b4:
                    31:de:aa:5c:de:ac:b2:61:54:b8:5c:cd:90:c0:7e:
                    64:78:4c:5e:dd:04:1d:cf:aa:03:13:81:fa:a0:80:
                    26:57:df:28:d3:8c:4b:7b:2c:59:90:a6:75:62:3c:
                    b5:bd:e0:b9:62:70:39:ca:77:76:e7:74:cc:52:76:
                    a7:b1:cc:47:6f:56:98:8d:0c:e8:9e:7a:a3:21:86:
                    f5:38:ca:1a:8f:a5:df:57:51:ba:76:ed:f4:27:32:
                    23:c3:07:b4:ab:01:2e:e2:27:97:29:60:05:6c:a2:
                    39:70:19:41:25:5c:79:64:ae:75:f2:08:d1:6e:dc:
                    e1:95:14:dc:84:7b:c7:d0:1d:93:74:60:7c:9e:ab:
                    fd:47:87:01:49:00:56:fd:c6:03:ae:28:8f:8f:f3:
                    51:99:08:45:70:7d:53:67:19:3d:fa:15:0b:37:57:
                    b4:49:92:7f:ce:69:21:46:d4:dc:3f:3e:ec:9e:de:
                    0d:52:95:e7:d4:b8:b6:25:a9:72:cb:c5:eb:b7:c7:
                    81:a1:38:9f:a6:d3:b4:fb:d5:ec:ca:c0:32:34:e0:
                    45:b7:a4:7f:05:42:81:1a:8f:3c:3b:11:d1:5d:83:
                    e0:8d:66:49:d8:f9:95:4e:04:94:8a:db:69:30:ae:
                    00:4b:f6:0f:5b:85:e7:d5:08:bc:67:1f:da:18:b9:
                    8d:6c:95:b3:30:39:43:ea:8c:93:6d:20:57:10:1e:
                    fb:f6:88:88:dc:9f:0b:ad:65:e8:f5:27:f8:5b:33:
                    bf:fb:d1:9b:e4:bc:11:29:94:13:7e:ab:d6:06:e3:
                    8d:d0:b1:53:59:d3:54:85:01:9b:a2:e8:cc:ec:d8:
                    6d:69:37:22:33:29:dc:9b:d2:e3:1f:27:c0:07:1e:
                    9d:b3:6b:1f:f3:60:1d:c7:31:12:2c:26:fb:c9:47:
                    8f:89:af:ff:df:f5:c9:58:27:29:c7:58:c8:42:7e:
                    76:ef:69:27:3d:56:cb:cf:a2:34:c0:2c:47:80:c4:
                    33:9b:2d:76:e7:7b:16:50:b0:de:8f:f5:05:89:4d:
                    0b:19:92:cf:d3:87:d0:d5:4d:a7:25:f7:c5:5d:eb:
                    2b:18:9b:18:e6:97:87:ad:c3:46:02:b2:26:5f:8c:
                    de:80:0a:8e:25:83:53:6a:c1:66:70:f0:61:33:37:
                    0d:3d:ad:1a:7e:bb:e4:04:15:47:7c:34:e2:af:4d:
                    a9:df
                rsa3072 key material:
                    30:82:01:8a:02:82:01:81:00:b4:94:e1:a8:8e:f6:
                    f5:cc:27:b3:2b:4d:d5:40:3c:c3:04:a4:77:2f:41:
                    06:7b:32:4a:85:6c:57:6f:f3:69:32:ba:dd:51:f4:
                    1b:32:2e:73:79:8f:4d:a9:d0:eb:e0:51:f3:a0:82:
                    f3:8c:9e:c8:f6:3c:c2:e5:00:01:36:97:ed:7c:4f:
                    4d:ee:59:4a:46:f6:21:dd:18:09:07:3a:16:e4:94:
                    ee:81:d7:e3:cf:d6:06:af:3b:c8:d8:14:b5:49:3a:
                    7f:4d:e9:84:43:73:fe:02:7d:a9:03:ef:70:a8:5c:
                    5c:2b:03:61:64:a9:39:6b:cf:c5:7a:df:54:c7:88:
                    f3:77:4a:6b:d1:10:ea:7f:ab:71:44:b4:df:b3:85:
                    94:5c:05:6d:db:46:37:ea:f9:5d:e0:ff:72:c8:62:
                    a1:96:a3:65:d0:a6:7d:d9:78:ee:7d:ca:a1:8e:8a:
                    ee:4a:bf:00:15:b5:59:c8:af:88:dd:bb:1b:53:c2:
                    1a:3a:49:08:ab:1d:5f:92:f8:4d:be:19:24:e7:01:
                    bc:1d:26:02:fb:2e:70:ff:ee:49:ba:0e:63:30:aa:
                    6a:65:a3:69:a6:1a:b3:72:36:f2:66:fd:57:b9:8d:
                    b8:09:17:4b:f9:0a:45:be:b0:78:86:bd:33:20:93:
                    78:30:50:ce:ff:b3:2c:6b:85:1c:c0:4c:72:14:2f:
                    9f:da:5b:af:24:d5:e8:83:ef:48:e6:cc:09:7b:91:
                    f9:38:75:6a:3a:fd:e5:f5:d5:f4:a0:e6:ab:8a:87:
                    96:c8:ad:38:7d:9c:a6:99:a1:51:5d:b7:59:c0:eb:
                    c2:7f:97:cf:8c:be:f3:0a:a7:5d:64:06:ba:c9:03:
                    48:17:9c:82:8b:5d:72:e1:9a:5e:10:eb:3d:5b:13:
                    e9:27:4d:00:f3:b2:bd:21:b8:0d:8e:07:a7:4d:d7:
                    db:e9:d9:d1:0b:25:81:b4:f6:2f:82:59:92:74:70:
                    33:10:d1:e3:de:77:49:9a:d1:0a:77:22:64:99:36:
                    f3:a1:0b:02:03:01:00:01
        X509v3 extensions:
            X509v3 Subject Key Identifier:
                3D:CF:C1:B9:A7:B4:82:DD:B4:99:DB:F2:B2:B1:F9:9F:55:78:B3:2F
    Signature Algorithm: mldsa65_rsa3072
    Signature Value:
        30:82:0e:77:03:82:0c:ee:00:be:fb:1a:4b:9e:20:62:66:71:
        4d:f3:6a:4c:53:aa:5b:fd:ae:b0:65:dd:bc:b8:b5:dc:c6:20:
        4a:47:d7:ad:e6:58:22:10:9c:2d:b0:f7:9a:9e:19:f1:04:ce:
        92:e3:8c:29:b2:7b:3e:6c:36:93:38:d3:6f:ce:43:72:f0:e4:
        66:db:ba:18:6a:af:08:99:90:9d:04:cf:b8:1e:1a:d3:90:0e:
        a5:29:10:e7:58:64:7f:3f:cb:2a:80:9a:55:1b:b0:99:fb:70:
        19:f4:c1:3f:ae:cd:2b:57:95:e5:6a:32:d8:6a:4b:1d:f8:26:
        3d:78:33:c3:fd:c9:0a:4a:a1:88:f8:67:0d:7d:b8:e5:8e:2c:
        62:0f:25:61:bb:ee:55:1a:34:84:31:b0:32:4e:45:1e:f7:90:
        55:ea:17:a7:0a:6a:06:54:75:2b:bb:9f:35:e7:57:c5:96:a7:
        b7:3a:7f:07:cc:e1:e2:c6:6c:43:dd:73:a1:f4:8a:33:88:89:
        28:9f:95:de:95:54:76:b0:96:f0:b1:a4:06:6c:79:60:71:8a:
        d9:0b:16:ea:d5:d1:80:6f:cc:01:b6:5e:c6:21:33:c1:4b:d3:
        5d:ad:ad:df:bd:50:2b:28:2d:08:19:0d:84:45:0a:be:c8:ba:
        44:3c:30:34:48:c2:1f:ee:e9:72:a3:e7:48:80:c9:58:77:2f:
        fd:b7:1c:f1:b1:ef:6a:df:bb:80:19:f8:cb:cc:db:e5:cc:fe:
        24:c4:85:9f:5c:fc:d2:51:89:e8:d0:d7:f6:49:32:7b:24:8e:
        bd:2f:a9:af:79:fc:16:cc:01:51:7c:f4:8f:70:de:2e:e5:61:
        58:a2:c2:eb:05:93:15:a3:78:f7:7d:58:1e:ff:c7:45:80:f8:
        59:e2:02:de:e0:0d:9a:8a:d6:3b:3f:b0:95:36:63:4c:26:ee:
        de:76:69:52:85:1b:da:60:04:97:06:bb:d3:59:27:2e:9d:c8:
        27:28:e3:22:7e:74:45:47:6e:23:ca:6c:9c:13:bb:6e:7f:9e:
        c4:53:7a:38:9e:80:cc:5a:7f:07:63:ee:8e:31:e8:ea:d4:cc:
        e2:1b:34:db:c7:92:8b:4c:46:35:89:5e:3f:fd:dd:44:ae:90:
        87:ea:e4:67:87:83:b1:5a:ab:a9:65:df:e3:65:ef:bf:4b:78:
        8b:96:a5:5b:18:89:b6:35:34:c4:70:8c:b4:d0:9c:e2:e2:a4:
        93:de:b3:e3:cf:16:8c:d1:d4:41:c0:de:da:31:76:4f:ec:6d:
        12:21:83:c9:c3:a5:b8:3b:e9:41:7a:1b:e5:ff:e1:e2:49:73:
        79:b6:67:12:e6:a2:7f:df:06:db:89:f9:cc:d6:7c:99:1c:1a:
        ba:57:81:22:51:06:ae:f6:43:ec:74:63:9e:25:15:fd:63:9e:
        34:be:77:75:72:f5:dd:63:ef:05:e3:ae:2c:e7:90:0d:09:da:
        92:8e:92:69:07:15:70:d5:73:f2:b4:89:6f:09:1e:84:af:e8:
        94:93:ec:10:0c:fd:d0:f0:aa:a1:ac:8a:91:aa:c9:72:3c:c2:
        5e:69:01:6e:dc:eb:6f:c2:87:e0:a3:39:ba:56:65:93:f1:3f:
        5f:d8:a6:b0:76:e8:66:c7:96:b8:e6:28:78:cf:7e:ab:05:b1:
        0d:04:c2:b6:f3:ba:dc:34:56:2b:3c:28:55:95:18:75:5e:2e:
        54:0b:f5:14:71:d8:32:35:ab:3e:2b:a0:d9:7c:12:97:70:21:
        98:57:3a:85:51:45:1f:c1:e6:88:ba:9c:65:f3:60:96:de:45:
        52:6c:ea:81:09:00:67:30:60:bd:73:c3:4c:21:f1:18:69:6e:
        bf:35:31:f8:64:c1:de:65:b4:6e:0c:3d:f8:cb:15:cd:b6:f3:
        2d:45:60:0d:c0:9f:88:02:3d:91:cd:73:41:66:84:8c:6a:19:
        91:78:1d:bf:e3:61:47:cd:d9:54:e9:95:cd:f3:c1:b5:c3:0f:
        91:35:47:1f:ac:97:bf:6b:0c:90:9a:d4:f8:71:cb:ee:9f:44:
        a9:1f:74:14:47:6f:dc:02:ee:c1:e6:7a:98:32:3f:aa:e7:dd:
        99:fc:c3:be:73:6f:fb:08:7c:14:83:77:f2:ca:5c:cb:11:39:
        46:38:f6:68:87:46:74:01:71:9b:83:0c:8b:4b:10:03:d0:a0:
        a2:11:fb:54:0f:35:82:0c:bf:0a:8a:99:d5:17:19:c9:e2:a5:
        27:83:1c:00:52:04:7c:09:6c:55:63:ce:37:6e:63:03:9f:30:
        03:22:6a:ab:1b:8b:19:5e:83:4f:06:1c:77:bd:df:4e:53:86:
        e6:36:78:45:c0:13:09:9f:a1:30:54:f4:61:53:23:97:84:6a:
        64:45:67:19:a0:44:cb:8d:28:75:88:d9:b1:ca:a0:ee:6a:ad:
        3a:9e:39:c9:f3:c4:cb:5a:0f:55:45:7b:fc:cd:f4:89:41:f4:
        b6:17:78:c8:be:22:d6:f9:90:74:6a:ae:27:38:24:0f:b2:50:
        31:96:fd:e0:2e:1d:3f:cc:8f:99:72:83:ad:da:b9:b6:56:a6:
        ae:54:1f:e9:c0:e3:eb:13:87:5a:73:59:ef:82:26:d9:0e:72:
        1f:12:28:24:e9:dc:f2:11:97:e9:f7:fd:e5:e7:17:0e:83:06:
        be:1d:b9:66:b0:ad:06:2f:ec:54:05:e5:de:b3:43:b4:66:f5:
        3b:35:9c:b2:4d:f1:47:6f:4e:af:dc:d5:bd:99:56:da:33:fa:
        9c:12:cd:d3:4b:33:26:39:a1:82:af:fc:5e:31:a8:06:1b:33:
        8a:e6:14:a4:65:f6:1d:14:d6:39:c0:ba:df:ea:17:86:51:62:
        91:ea:b7:02:24:c0:93:cc:4b:ea:ce:e3:fb:3a:cb:5b:3a:7f:
        25:60:11:cf:4d:83:c0:5d:24:4d:cc:cc:3a:d4:85:e5:55:e0:
        c3:f5:20:e2:1d:53:42:a5:1b:40:03:a8:32:4c:27:dc:25:9b:
        3e:0c:68:61:53:f2:10:fc:6f:64:d5:e8:b0:9f:33:fb:15:b1:
        50:d6:9d:d5:18:60:0f:e1:66:d8:68:02:ad:ee:ad:1c:db:57:
        ae:73:41:a3:30:aa:b9:c6:8f:4a:e7:78:e6:00:23:64:b5:ca:
        a7:7c:1b:fe:98:3d:73:3d:78:71:e8:c3:f4:ba:56:e2:ee:2a:
        3a:00:52:90:6c:48:8d:db:df:e4:00:9d:e7:e5:e6:f8:75:80:
        b5:53:38:f9:e8:12:33:07:61:7c:32:d1:b5:c3:b7:1b:6c:21:
        de:1a:41:bc:1b:f1:1e:d9:ab:7f:ca:8c:cd:bd:90:38:97:c4:
        d3:fb:f8:c7:43:fd:31:25:b6:83:96:7c:87:0e:fb:b3:fd:0f:
        f9:f4:6e:a2:92:b7:2b:b3:ab:b1:41:64:84:58:bb:ea:09:d1:
        9c:34:29:24:ff:f0:e8:a7:76:6f:d1:18:1b:d4:25:8a:d3:e0:
        5a:c7:29:d7:25:c6:d3:c0:42:c7:cc:c9:19:8f:17:ae:d8:62:
        ab:35:2d:8b:a9:d4:42:d3:29:09:d5:ff:3b:54:9e:67:b0:82:
        df:ff:b6:de:03:f8:35:b2:aa:f6:e4:38:21:b1:be:11:ef:ba:
        e0:c2:08:84:cf:4e:1a:1c:e1:ca:57:23:9a:7b:88:25:cd:66:
        bc:ea:f9:9b:f4:9d:7b:08:4a:32:9d:c3:ba:5e:50:85:f5:b8:
        6b:b2:c2:49:89:58:f5:17:1c:f5:d6:74:d5:ed:86:0d:59:b8:
        91:92:61:73:21:d6:a5:3d:d1:03:4c:88:11:88:dc:43:9c:00:
        c4:7c:4e:78:1a:b9:89:1a:52:a4:f9:bb:9a:0b:19:c3:59:9e:
        54:91:36:ff:90:be:2e:c8:38:01:24:e1:48:02:35:55:fe:1a:
        f3:02:50:1e:c0:2b:2c:5b:b5:41:1e:a8:3e:cc:50:61:e3:41:
        d0:0f:31:9b:4c:96:c5:35:7f:e1:bc:95:55:0d:86:da:39:63:
        b1:5c:34:76:6e:0b:b7:a4:8f:dd:63:ec:70:1e:72:78:c0:4b:
        ce:87:29:13:ee:5f:9e:e5:17:6d:9e:a1:f0:bb:5a:a7:ba:11:
        fd:11:38:94:65:c9:f1:7a:7d:8a:6f:ad:e9:cb:df:dd:f9:74:
        29:d9:0c:f8:b4:72:22:ca:c1:2e:50:2a:c0:9a:24:4e:86:37:
        d6:60:7e:fe:4d:31:55:9a:d3:70:32:16:73:34:3e:a7:b0:15:
        c0:08:89:a5:58:d0:9f:77:f7:60:44:6e:8a:52:6e:dd:07:f0:
        ed:f4:40:58:e8:4d:f6:cd:97:2c:7f:e3:62:54:62:a3:03:0e:
        4c:dc:ae:ad:f8:2f:5f:2c:bb:15:c7:b1:23:19:25:35:9f:f8:
        6a:09:ad:b9:a6:1d:61:8a:c1:d0:4f:49:f0:6b:d7:13:e3:cd:
        52:fd:c0:3e:35:07:ea:3c:fe:1d:43:17:51:bc:ae:3c:32:50:
        9e:97:23:6c:6e:2f:15:9a:78:47:99:dc:0c:24:5f:f0:18:12:
        a4:ad:2f:fd:6f:ff:d7:42:cf:21:d7:c1:73:9f:52:3e:c1:e8:
        e2:20:55:ce:e4:38:e8:7a:7b:e2:af:2d:88:ea:3c:a5:2e:65:
        9c:6e:1a:03:39:b3:d1:cb:f2:d4:43:84:8e:a4:56:a0:a0:22:
        0a:3b:fc:28:a1:b9:b6:c4:53:07:76:b6:3a:c3:0b:83:91:a0:
        ff:6a:2c:d3:62:94:a5:4b:2f:66:e2:99:3a:d8:96:96:ee:6e:
        bb:67:b3:7b:de:14:80:da:4b:8d:fd:b1:4c:9b:15:d4:da:61:
        f6:5a:7d:e8:4b:58:3c:63:8b:e6:a9:35:3e:4d:bd:c6:90:0c:
        71:07:d1:98:9f:00:91:7c:cf:c7:32:86:18:8c:f5:4b:e2:1b:
        cd:d9:e8:f9:af:e6:f0:50:e3:1e:a8:ab:5a:72:44:8b:f0:b4:
        0b:d5:1c:18:df:b7:ec:09:d0:1b:a1:0f:5b:0e:a0:36:0d:a7:
        35:34:06:34:90:c6:0a:b3:3e:c6:62:26:4d:9d:1a:85:6a:b6:
        75:ae:53:15:47:ce:e8:cf:0f:86:ce:07:df:3c:76:e7:ec:c3:
        1e:06:fa:86:42:73:5e:0b:db:56:4d:97:09:e7:cb:d1:cf:0d:
        f0:0c:d4:af:6d:e9:6b:a6:11:80:bd:83:15:e6:3f:44:04:47:
        ad:f1:25:ef:fc:40:f4:d0:6b:9c:21:46:ce:86:fa:e0:6d:b0:
        b6:04:22:b0:2c:78:b4:be:08:b1:69:51:c7:a7:33:c6:32:71:
        6b:09:b9:2a:62:04:b0:b8:fa:2a:c4:ca:1f:46:df:9b:9e:74:
        ec:be:6a:2e:36:69:5b:88:72:a5:d8:b4:5c:19:c8:06:b3:60:
        77:84:a8:c4:1d:ec:8a:63:31:e3:33:ba:34:37:c9:8c:fc:c6:
        36:e1:a3:e8:61:5f:cb:05:53:1f:9d:d0:b0:90:86:0c:36:37:
        cb:65:8f:79:a6:f5:7f:7c:0a:cd:c8:be:2c:89:b2:19:c6:29:
        24:18:2f:6a:08:b3:b6:e4:ae:fb:1d:90:ad:84:fb:86:02:4b:
        ba:17:53:a7:d6:3d:34:4e:fe:fc:e4:5c:e2:02:68:95:1f:0f:
        03:84:f4:73:04:f8:20:b7:41:4c:b5:80:bc:81:13:3b:db:f4:
        da:4b:b9:e5:bb:93:7e:40:29:d8:f6:6e:5d:a6:ad:1d:71:ee:
        0e:a5:29:ef:33:5f:6c:87:7b:36:fa:2b:bc:5c:5b:01:c2:40:
        76:14:96:b8:48:66:2f:a1:18:54:eb:f5:50:60:5f:5a:93:e2:
        8b:bb:ed:f6:6f:38:a5:85:cd:07:ab:38:12:9d:b1:8f:b9:17:
        6b:f3:af:af:c1:01:fd:a2:8c:43:63:a3:2a:a8:26:7a:63:9b:
        81:8b:28:9b:93:1e:5d:da:3a:b1:42:1b:9d:44:a1:c8:d2:00:
        c3:58:6d:d0:dc:2d:be:58:81:59:d3:2d:84:d8:80:52:22:c0:
        c7:83:27:d5:1e:4f:dd:c5:13:f7:9b:79:ba:e9:5a:db:a6:bf:
        6b:e1:6b:74:4b:ad:be:d5:c0:e2:15:a5:fb:70:a4:c0:b1:a8:
        a5:8e:f4:c6:52:00:72:e2:ab:13:fa:db:ab:69:2e:46:75:73:
        8c:26:97:1e:23:c3:49:4f:bd:06:a4:fa:c2:eb:02:b9:74:65:
        c4:ba:fb:6e:15:8d:83:ef:9b:b9:54:b1:95:02:75:76:7b:b1:
        71:52:19:64:f2:c0:cb:70:48:3d:4f:39:44:2b:d5:71:f7:3f:
        97:95:e4:9e:b3:1f:ce:27:61:c7:6d:82:e0:0e:6a:17:e3:f9:
        4b:f5:d6:0d:17:37:33:bc:14:bf:fa:96:64:c5:71:33:ac:af:
        c8:f8:44:19:1b:82:cb:3d:45:95:5e:76:aa:4f:54:3c:bb:91:
        eb:4d:57:85:b5:7b:21:f1:48:72:3b:91:3c:83:46:cc:6e:48:
        e8:63:11:73:68:52:54:31:5d:ef:bb:ae:23:c8:c1:33:ae:2d:
        6b:63:78:51:69:23:9c:ea:b6:56:12:fa:d0:e2:b7:3c:b0:56:
        1d:85:4a:cb:50:ee:f1:5d:cc:cf:e1:d4:fe:61:a1:76:f0:07:
        70:7e:96:12:14:b8:8c:44:00:af:34:00:38:c0:f1:69:22:4d:
        65:80:18:d1:7d:30:32:cf:8b:4c:26:5d:10:80:7c:51:d8:42:
        87:63:0c:82:5b:f0:8e:f8:53:38:40:c3:54:c9:5b:af:18:be:
        ef:3c:d0:4f:e9:af:b6:7d:44:7c:f2:e4:7f:6e:7b:5e:ad:f1:
        ba:a1:1b:0e:fe:6d:dc:95:9d:43:e6:c7:1e:78:8a:be:97:2e:
        13:f7:f0:5a:58:80:ed:75:cf:91:a7:71:27:9a:0e:2a:36:12:
        1d:66:89:b5:5e:93:1d:06:8b:b8:f1:45:b0:59:b8:69:4d:bd:
        78:6d:d3:55:49:5d:66:ec:e1:8d:d6:e7:74:48:ca:1e:74:d8:
        42:70:0b:39:19:78:1d:1b:26:63:b9:41:be:c4:83:17:e5:65:
        31:fd:10:a9:d0:1a:95:25:fc:e4:ce:8a:35:05:91:33:18:1f:
        e8:b9:8d:38:60:5d:7f:32:ad:90:23:f4:62:e6:1b:0f:28:76:
        01:8c:8d:51:95:95:a5:b5:f3:e6:2e:ee:50:f1:30:55:6b:61:
        21:d4:4d:1f:a8:63:fd:b9:0a:ac:6b:62:f2:79:a3:f2:f3:7b:
        8d:01:42:7f:4c:62:4e:66:ed:e0:c6:de:53:cf:f0:d7:d6:b2:
        60:86:da:77:82:26:e5:32:38:56:25:0d:e0:ab:10:d9:67:bf:
        28:de:b4:ee:3d:f9:27:7b:fd:71:6c:2c:3b:56:9c:5d:47:66:
        4b:c5:8d:5e:18:91:93:c6:78:b9:4a:4a:33:20:d6:cb:07:36:
        bb:fc:d6:b9:3e:98:06:33:50:75:fb:b2:c6:d6:b2:b8:c7:dc:
        54:8b:1f:e2:c5:8b:8b:85:ec:56:3f:1b:d9:8f:1a:ae:88:38:
        96:21:21:ab:4b:e3:55:93:7e:d1:bd:20:ae:c9:91:9e:db:d4:
        af:46:09:cd:dc:0a:29:bf:a2:f3:d9:c5:59:43:7d:60:db:76:
        87:aa:58:b7:8b:e1:e3:cc:e3:7e:27:db:95:4b:c6:cb:83:b1:
        bb:3b:4b:99:7f:4d:66:f0:bc:0f:c2:a6:20:98:08:08:c7:55:
        f6:d9:4d:99:40:58:7e:5c:aa:e7:97:25:9c:e8:b7:cf:48:b3:
        92:8c:bf:4f:09:46:79:73:70:ae:00:6d:a0:48:ea:fe:9c:31:
        83:7e:41:fe:50:7c:8d:65:13:49:11:64:82:9e:1f:19:6b:be:
        e8:2b:31:99:d7:fd:fe:77:51:0d:0e:2d:14:8b:c2:8a:40:48:
        a4:58:ae:74:e3:54:41:b8:7c:0b:3f:c0:85:06:90:eb:b3:e0:
        70:2b:c6:11:2f:1a:7b:44:63:c1:35:1d:78:2d:dd:fb:6c:82:
        a1:f2:c9:6b:c6:48:90:ce:d0:30:56:e2:24:45:bf:8c:07:61:
        97:ef:c4:2e:8a:fa:a1:c6:b8:73:d2:fa:c3:a0:d0:de:0f:d1:
        55:f1:a4:a4:3b:82:5d:2d:dd:15:69:6e:21:2f:69:a1:0c:a2:
        f8:78:92:90:6a:5e:f3:c5:db:0d:2a:e9:02:4b:c9:90:2a:90:
        01:e3:98:34:c6:1a:b1:bb:5b:dd:3e:e0:d5:64:2c:83:c9:0c:
        09:5d:45:77:3d:9e:cd:04:1d:29:11:86:d0:2e:a0:5d:77:f3:
        71:e2:e1:dd:cb:77:cd:e0:3b:10:38:4f:1b:7b:af:5a:11:56:
        8b:2d:d6:79:05:97:92:86:29:62:7f:4b:1c:6a:78:6f:14:6c:
        67:ec:87:6e:de:db:77:a1:f2:d9:e4:47:8d:1b:5b:81:28:8d:
        1c:26:38:8b:2b:ef:36:e9:c7:bc:b2:93:39:be:6d:f2:23:0e:
        47:4d:3e:68:53:b5:aa:d9:74:48:0a:66:32:e7:c8:1e:e2:dc:
        3e:00:72:ea:32:50:ca:df:5b:f0:75:9f:85:2c:a7:48:49:45:
        ab:38:b0:9c:da:db:94:bf:d7:3c:ec:5b:b4:b4:ec:9f:28:18:
        34:37:4e:51:65:6a:84:88:a3:b1:c3:ca:d1:e7:72:82:eb:2f:
        4c:59:5e:95:c6:cb:e5:53:c4:ea:ec:f7:fd:17:1f:26:6a:71:
        d4:1a:37:75:8a:b2:f8:00:00:00:00:00:00:00:00:00:00:00:
        0f:12:1a:20:26:2c:03:82:01:81:00:8f:72:90:52:ee:15:b2:
        10:eb:6b:da:0e:0a:da:14:43:d7:2b:7c:00:b1:8e:aa:2a:ab:
        e1:22:33:7d:90:ef:fc:6e:e1:2d:eb:47:84:e9:fe:43:ce:22:
        91:eb:80:1d:40:cb:c3:45:da:0a:35:c6:d9:79:90:4e:ec:47:
        ea:82:69:e5:e4:6f:3b:5c:e2:6c:c5:87:66:46:b0:28:16:f6:
        bf:cc:a7:40:80:7b:cb:e8:85:f5:82:64:a7:bd:d8:a2:d7:3c:
        90:32:fb:04:9c:60:99:7a:7e:e3:c9:09:b9:1c:02:28:9c:22:
        f1:cd:dd:bb:17:e5:94:b2:d6:e1:1c:59:f4:8c:af:a7:b9:a3:
        fe:44:bb:48:4b:49:dd:10:78:07:6e:23:bf:27:f7:b4:6c:eb:
        96:24:47:df:75:8e:a7:58:ac:26:01:18:2f:ce:b2:6f:f8:42:
        43:8c:07:43:bf:6c:1c:e5:93:9c:56:14:3c:d9:2e:27:60:fb:
        8a:b6:f9:d3:9e:45:39:59:ca:bc:b2:5b:8e:f7:7a:8e:26:42:
        4c:4c:05:85:4d:fe:27:bf:bb:8d:5a:0b:22:32:97:7d:76:cf:
        1e:9a:a3:91:71:18:4f:5e:be:7f:10:cb:9e:46:c9:b8:ad:1c:
        b5:77:cf:8b:ef:6b:32:01:9b:2e:6f:a3:65:87:02:fe:66:5f:
        41:d7:82:ad:ae:46:5e:db:25:cd:4b:9d:71:9b:ad:6d:a9:38:
        85:b3:c1:e1:2b:d4:e3:52:df:97:5e:68:a6:13:74:cb:94:e3:
        32:56:6d:a3:dd:e4:45:4a:0f:a5:d3:24:ba:ce:1c:38:d8:b3:
        01:98:ec:87:bb:c8:ae:d4:a0:bb:92:80:86:8d:91:76:ef:05:
        18:37:37:fe:b1:3c:e7:b3:6e:c0:ef:3d:5b:77:9f:43:37:68:
        18:f5:3b:f0:13:b7:6f:83:6f:a8:70:20:c6:11:50:10:e0:fc:
        65:41:a4:85:96:24:84:83:4e:07:38:f9:11:02:36:51:63

Br
Maro

@maroueneboubakri maroueneboubakri added the question No code change required label Aug 8, 2024
@baentsch
Copy link
Member

baentsch commented Aug 9, 2024

Tagging @feventura for advice on separating classic from composite keys.

Then a question to @maroueneboubakri : Are you saying that #372 is resolved then? Would you be willing to share there how to do that so it can be closed?

@maroueneboubakri
Copy link
Author

Tagging @feventura for advice on separating classic from composite keys.

Then a question to @maroueneboubakri : Are you saying that #372 is resolved then? Would you be willing to share there how to do that so it can be closed?

@baentsch that works for hybrid keys, but seems not for composite keys, if that thread/PR is supposed to support both hubrid and composite then I need to double-check for potential bug ?

@baentsch
Copy link
Member

baentsch commented Aug 9, 2024

I need to double-check for potential bug

I'm afraid so: The solution by @thb-sb in #372 pre-dates the integration of composite keys, so there may indeed by something fishy. That's why I tagged the author/contributor of composite sigs, @feventura to possibly also take a look. And while we're at it, maybe also tapping @praveksharma for ideas knowing his interest in composite keys, too.

@ounsworth
Copy link

ounsworth commented Aug 9, 2024

Hi @maroueneboubakri .

Could you explain a bit more about what you are trying to accomplish by extracting the component keys?

I have two conflicting opinions about whether an API to break a composite into pieces is a good idea:

On the first side, the whole purpose of a composite is to treat the whole thing as a single key. If you start extracting the components and using them for cryptographic operations (sign, encrypt) outside of the composite, then that completely undermines the security properties of the composite. The Internet Draft is very clear to never re-use component keys. So in that regard, the API you ask for is quite dangerous and can be easily mis-used.

On the other hand, I could see people wanting to extract the component keys to perform checking on them -- ex.: key size, modulus, checking for Debian Weak Keys style RNG problems, etc. And in that regard, such an API seems useful.

@baentsch It's probably reasonable to have an API to split a composite public or private key into its parts, but we should probably put some strong wording in the oqs/openssl documentation that you open yourself up to downgrade attacks if a verifier or encrypter / decrypter is willing to use the same key both in a composite and by itself, so reuse of composite component keys is strongly discouraged.

@maroueneboubakri
Copy link
Author

Hi @maroueneboubakri .

Could you explain a bit more about what you are trying to accomplish by extracting the component keys?

I have two conflicting opinions about whether an API to break a composite into pieces is a good idea:

On the first side, the whole purpose of a composite is to treat the whole thing as a single key. If you start extracting the components and using them for cryptographic operations (sign, encrypt) outside of the composite, then that completely undermines the security properties of the composite. The Internet Draft is very clear to never re-use component keys. So in that regard, the API you ask for is quite dangerous and can be easily mis-used.

On the other hand, I could see people wanting to extract the component keys to perform checking on them -- ex.: key size, modulus, checking for Debian Weak Keys style RNG problems, etc. And in that regard, such an API seems useful.

@baentsch It's probably reasonable to have an API to split a composite public or private key into its parts, but we should probably put some strong wording in the oqs/openssl documentation that you open yourself up to downgrade attacks if a verifier or encrypter / decrypter is willing to use the same key both in a composite and by itself, so reuse of composite component keys is strongly discouraged.

@ounsworth Thanks for the explanation !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question No code change required
Projects
None yet
Development

No branches or pull requests

3 participants