Manual/CertMan

[CertMan] ๋น„๋Œ€์นญ ํ‚ค ์Œ ( RSA, ECDSA, SM2 ) ๋งŒ๋“ค๊ธฐ

JayKim๐Ÿ™‚ 2023. 6. 16. 09:04

๋ผ์ด์„ ์Šค๊ฐ€ ์—†๋Š” ๋ฒ„์ „์€ RSA ๋งŒ ์ง€์› ํ•ฉ๋‹ˆ๋‹ค.

CertMan ์„ ์ด์šฉํ•˜์—ฌ ๋น„๋Œ€์นญํ‚ค๋ฅผ ๋งŒ๋“ค์–ด ๋ณด์ž
ํ˜„์žฌ CertMan ์—์„œ ์ง€์› ํ•˜๋Š” ๋น„๋Œ€์นญํ‚ค ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ RSA, ECDSA ์™€ SM2์ด๋‹ค.

์‚ฌ์‹ค SM2 ์˜ ๊ฒฝ์šฐ๋Š” OpenSSL ์—์„œ ๋ณ„๋„๋กœ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํƒ€์ž…์„ ์ œ๊ณตํ•˜๊ธฐ ๋ณด๋‹ค๋Š”
ECC ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ์ค‘์— SM2 ์ธ์‹์ด ๋˜๋ฏ€๋กœ ๊ธฐ๋ณธ์ ์œผ๋กœ๋Š” ECDSA ์™€ ์‚ฌ์šฉ์ด ๋™์ผํ•˜๋‹ค.

๊ฐ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ณ„๋กœ ํ‚ค ์Œ์„ ๋งŒ๋“ค๋ ค๋ฉด Tools -> NewKey ๋ฉ”๋‰ด๋ฅผ ์„ ํƒ ํ•˜๊ฑฐ๋‚˜
์™ผ์ชฝ KeyPair ์—์„œ ๋งˆ์šฐ์Šค ์šฐํด๋ฆญ ํ›„ New Key๋ฅผ ์„ ํƒ ํ•˜๋ฉด ๋œ๋‹ค.

RSA ํ‚ค ์Œ ๋งŒ๋“ค๊ธฐ

  • Mechanism : ์‚ฌ์šฉํ•  ์•Œ๊ณ ๋ฆฌ์ฆ˜ RSA ์„ ํƒ
  • Exponent : RSA Exponent ๋กœ ์‚ฌ์šฉ ํ•  ๊ฐ’์œผ๋กœ 5, 7, 17 ๋“ฑ ์†Œ์ˆ˜๋กœ ์ž…๋ ฅ ํ˜„์žฌ 65537์„ ์ฃผ๋กœ ์‚ฌ์šฉ ํ•จ
  • Key Length : ์ƒ์„ฑ ํ•  ํ‚ค ๊ธธ์ด ( ํ˜„์žฌ 2048 ๊ถŒ์žฅ ๊ธธ์ด )
PublicKey  : 30820122300D06092A864886F70D01010105000382010F003082010A0282010100B4200514663BF122A1404DB9549D271AD2102838A3D6E219A5C4AB259320075CCEFC408F4CBA54BBA1B4577798B03EEBFE426E23A3781FF2DAB8E125DD9082808A7A3353CFC1120AF46DE1558A4945BA4D30401AB8CE9CB1E3194C5E59E6869646E670B7570D07F5141B51D4712EE9604B9183ACBC76C39ECBF05E3FFD368094AA04CF6CBF6A36A4BB7674510DBA4195D61EA71D9CC0F065CD1383890E5828884C2DE1A3077B62A67476D86C49A6FEA7D17D6C4B884EA9CFBF2711B6ECCCECA8415558652B65E87291B0A8101A07FB98DEC43BFD4A8C5B00BC2B313769450AC43577AE26FBF9A26791696D470CDC3985986243921535863F9D44BEF31BF1CF910203010001

PrivateKey : 308204A30201000282010100B4200514663BF122A1404DB9549D271AD2102838A3D6E219A5C4AB259320075CCEFC408F4CBA54BBA1B4577798B03EEBFE426E23A3781FF2DAB8E125DD9082808A7A3353CFC1120AF46DE1558A4945BA4D30401AB8CE9CB1E3194C5E59E6869646E670B7570D07F5141B51D4712EE9604B9183ACBC76C39ECBF05E3FFD368094AA04CF6CBF6A36A4BB7674510DBA4195D61EA71D9CC0F065CD1383890E5828884C2DE1A3077B62A67476D86C49A6FEA7D17D6C4B884EA9CFBF2711B6ECCCECA8415558652B65E87291B0A8101A07FB98DEC43BFD4A8C5B00BC2B313769450AC43577AE26FBF9A26791696D470CDC3985986243921535863F9D44BEF31BF1CF9102030100010282010000977E3366678CD66E381658BB2E925F2526C56731F55C903FE772552FE3EEC591E7F6F117A6797A721FA02CB29E9E4D798F67F76F1C65C8676FD45541B88A2A2F766B73EC00BDF766017D94FE5CB131F3E89F4B1613EEDDECD0A9FABD196CA5D6FC22D40B3BA750247786EC9B5672E051028D1992F0855C8EF43500946701D9D2076D1E58BEC5B30C922DD70BC6D5B0EE320B1554DACB19CD6D9A0B53E1442BB5E5C2331E96BE8056F569078522CAC594F34A0267DA8D7AB164D19C4842E0512701C5265F5BB5D367CDF99DC831D57E05FDB13BD6CF944BA6E35A1D4F755600B970FBB9E66045E5CB7F3BACBEA53CFF934B7CADAD3804E4CAD0B77AA74B689102818100B59753B2DB3DD200DABD835D1D8BB5233D936480A33CB1EC5D38E31502D4CAEA7E305565F3C793551A444C2F20EE27D96373AB9299C5299994E1A1F2D602A80BB6E1FB266085E59FE742153E56715A507FD76AE053FBD6263B0597E9F11C54F2BFB66723B2A0403FDB10DF551F66701EF3EA2DC7FF744ABAB7034CD0ECF39A4B02818100FDEEE827079415B949345A4235F0C7C412CB56B551ED415FB768C8ACF5D0B65359C60049EA4A8A0D5C8B72DC73373A127DBAF57B837490713B6A5F347F6FDFB813858BA6A7996573E799FBBD143D60AC5E1D763DDFA3F2FD6C3108DA70E9A34BF8900082824BF02D99147F0C3246FA9DE3932D2B602951AD96BA0B3C67BE94130281801248DD85A9EBCCA4876203C331816AC8D49F6DC4422B8F62D47430F161AA9990090AC6DE90306D566961AD2625B3B5517F611B4A94AF34A42148A2ECF7BDA6BC1F3B1BF5DE4C3D35DFAC58C5412102CE0E415BA2A0F23FBAF3C0796E75F7BB5A0211D4CAD466AC7181966E567CE5ECAE4133384EE61B08974A6C4BA4D1E7298702818100E8089F6FD297F945C6E3A4BA2DA9E8107D8FFA9A52D376522D38FD6E366C51BE5620FC708E3B306CC72CD177297CC47ED30EBC73F189D8D6EF10E3100886C4A9E284BC383B9B8ABDDF5AB052752524AA3C91B5531281306F6BA65ECDA43189BAC8D564F1DC77E16EF91B6680518CD442E409BF538C5A153D86A657D0098876AB02818049BC45EA62D34177C1CBE91403E2F7F2C71F9119D774546A702EA3E7F953B687C1540746BD9BA3795591E4209D6D7A85B05FD724FB6EB41CDE5A488AD6D49BA334561BB2FA29CF8C307905672D4BB6D4D8103134328EA4B42C44F47F4C2A6D51D07873AD82312571181DF68398B29E6357534B3C9F576A843BFA033E42604103

์ด๋ ‡๊ฒŒ ์ƒ์„ฑํ›„ ์ •๋ณด ํ‚ค๋ฅผ ์„ ํƒ ํ•˜๋ฉด ์ •๋ณด ํƒญ์—์„œ PublicKey ์™€ PrivateKey ๊ฐ’์˜ ํ—ฅ์‚ฌ ๊ฐ’์„ ์ฝ์„ ์ˆ˜ ์žˆ๋‹ค.
์ฐธ๊ณ ๋กœ DB์ƒ์„ฑ ์‹œ ํŒจ์Šค์›Œ๋“œ๋ฅผ ์‚ฌ์šฉ ํ–ˆ๋‹ค๋ฉด ๊ฐœ์ธํ‚ค๋Š” ์•”ํ˜ธํ™”๊ฐ€ ๋˜์–ด ์žˆ๋‹ค.

ECDSA ํ‚ค ์Œ ๋งŒ๋“ค๊ธฐ

  • Mechanism : EC ๋ฅผ ์„ ํƒํ•˜์ž ( ECDSA ์•Œ๊ณ ๋ฆฌ์ฆ˜ )
  • NamedCurve : ์—ฌ๋Ÿฌ๊ฐ€์ง€ ECC ์ปค๋ธŒ๋ฅผ ์„ ํƒ ํ•  ์ˆ˜ ์žˆ๋‹ค. ์—ฌ๊ธฐ์„œ๋Š” P-256 ์ธ prime256v1 ์„ ํƒ

์ƒ์„ฑ ํ•œ ํ‚ค ๊ฐ’

PublicKey  : 3059301306072A8648CE3D020106082A8648CE3D03010703420004562A28D51DF1B60395CDFB3CC031BA7C47144F55A2EEAA69C7BF8CAE1E493A9B4BCF6E2E04FFE660B76E6C4ED94A583866C7A8A494E7B6F3777D792929AAA0FD

PrivateKey : 30770201010420D93067672A6EA972C3187EC16DA527729685EA44D8D30BEE2896791281E3B505A00A06082A8648CE3D030107A14403420004562A28D51DF1B60395CDFB3CC031BA7C47144F55A2EEAA69C7BF8CAE1E493A9B4BCF6E2E04FFE660B76E6C4ED94A583866C7A8A494E7B6F3777D792929AAA0FD

RSA ์— ๋น„ํ•ด์„œ ๋น„๊ต์  ์งง์€ ํ‚ค๊ธธ์ด ์ธ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.
ํ•˜์ง€๋งŒ RSA ๋งŒํผ ๋ณด์•ˆ ๊ฐ•๋„๊ฐ€ ์žˆ์–ด์„œ ๊ทธ ๋งŒํผ ์งง์€ ๊ธธ์ด์˜ ์ด์ ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค๊ณ  ๋ณด๋ฉด ๋œ๋‹ค.

SM2 ํ‚ค ์Œ๋งŒ๋“ค๊ธฐ

  • Mechanism : EC ๋ฅผ ์„ ํƒ ํ•œ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ SM2 ๋Š” ECDSA ์˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์ปค๋ธŒ๋ฅผ SM2 ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๊ณ  ๋ณด๋ฉด ๋œ๋‹ค.
  • NamedCurve : ์—ฌ๊ธฐ์„œ๋Š” ๊ผญ SM2 ๋ฅผ ์„ ํƒ ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.
PublicKey  : 3059301306072A8648CE3D020106082A811CCF5501822D034200045E4D3AAB06055C7544364C816741B4CCC936F343DB4FA2D94BAA1309CF08DC49D3435E7088007E92C1DA1186F1CD02872F9728367C26796A788B11BEF26A7B6A

PrivateKey : 30770201010420AF3BC1EB862E2B4A7393BE3E1FA7E32B7FB7679514CA1C41D25DACF411046777A00A06082A811CCF5501822DA144034200045E4D3AAB06055C7544364C816741B4CCC936F343DB4FA2D94BAA1309CF08DC49D3435E7088007E92C1DA1186F1CD02872F9728367C26796A788B11BEF26A7B6A

์ด๋ ‡๊ฒŒ SM2๋Š” ECDSA์˜ ํ‚ค Curve ์˜ ํ•œ ์ข…๋ฅ˜์—ฌ์„œ ECDSA ํ‚ค ๊ธธ์ด์™€ ๋™์ผํ•œ ์„ฑ๊ฒฉ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค.