Manual/OpenSSL

[OpenSSL] DSA ํ‚ค ์Œ ๋งŒ๋“ค๊ธฐ

JayKim๐Ÿ™‚ 2023. 7. 4. 09:06

DSA ํ‚ค ์Œ์„ ๋งŒ๋“ค๊ธฐ๋ฅผ ํ•˜๋ ค๋ฉด ์šฐ์„  DSA ํŒŒ๋ผ๋ฏธํ„ฐ ์ƒ์„ฑ ํ›„ DSA ํ‚ค ์Œ์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค.

๋จผ์ € DSA ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์ƒ์„ฑ ํ•˜์ž

openssl dsaparam -out dsaparam.pem 2048

์ƒ์„ฑ ๋œ DSA ํŒŒ๋ผ๋ฏธํ„ฐ

-----BEGIN DSA PARAMETERS-----
MIICKQKCAQEAz3b/DxqaD6NWa0q23jg3SJ8B/IPycYm7YClyMEh7OIqUhr0cckxm
+JosmcqD/S+vEHraQFCF05shdWVjDiY1eyxCo6S9NOgmkDsUTLHFI/5lw4Kf+cum
dd4FkMljKmSDybymg1NOggwVMQjbJ4LYS+35nktjLwGIWxo06Jjzt20AYCWpRkJo
JmLX1x2dtua1BFgdhhWinxlPNRNLVtLTcLtPgx16TuYP9NK2MvLSnJyLuAXtXWuT
ehHvDGz/TgyeUC1qwtyQeDqGTwW+9BvsjtHfwi4iMZB6sfpsxdtJ5uLrm6VGlOhZ
UxtAqGLyGbOPXc3w0+SGw5pxrVwhWW3XzQIdAJRFq12N69klBkhTc1vF43EfXiPM
b27J1wi57KMCggEBAI/FXRypqoW7efbbgcLabTLBSQAt7ybUKI/febqk3WquM6Rl
a6ms/7sqJqnmY4PRk6HCviEwDGfcCLphPXMgyXPfNJSEy/ikBovRBImQ6iXXmvk6
ZTiwH8tfDKx9gzGPChyLZB5i9lNVvKsOD2YlhpC3rDDCWH+PbKAiMZE6n56OeCpf
hrDVwMZl4upwElH/+JaNtEvHP6JWDYH7739fvQi5uxIdodzbbH9I+RAiarHghah/
uw4QHe74rEV6i5LlD0oyjW0E0Yv26UsrF1XoStruX7XZ3WuRUHw8QMFQWz1yHMqP
8ONvGll3quEhVbf79I+afI2ngiZ3kVlZSsZKaV4=
-----END DSA PARAMETERS-----

DSA ๊ฐœ์ธํ‚ค ๋งŒ๋“ค๊ธฐ

openssl gendsa -out dsaprivkey.pem dsaparam.pem

์ƒ์„ฑ๋œ DSA ๊ฐœ์ธํ‚ค

-----BEGIN PRIVATE KEY-----
MIICXQIBADCCAjYGByqGSM44BAEwggIpAoIBAQDPdv8PGpoPo1ZrSrbeODdInwH8
g/JxibtgKXIwSHs4ipSGvRxyTGb4miyZyoP9L68QetpAUIXTmyF1ZWMOJjV7LEKj
pL006CaQOxRMscUj/mXDgp/5y6Z13gWQyWMqZIPJvKaDU06CDBUxCNsngthL7fme
S2MvAYhbGjTomPO3bQBgJalGQmgmYtfXHZ225rUEWB2GFaKfGU81E0tW0tNwu0+D
HXpO5g/00rYy8tKcnIu4Be1da5N6Ee8MbP9ODJ5QLWrC3JB4OoZPBb70G+yO0d/C
LiIxkHqx+mzF20nm4uubpUaU6FlTG0CoYvIZs49dzfDT5IbDmnGtXCFZbdfNAh0A
lEWrXY3r2SUGSFNzW8XjcR9eI8xvbsnXCLnsowKCAQEAj8VdHKmqhbt59tuBwtpt
MsFJAC3vJtQoj995uqTdaq4zpGVrqaz/uyomqeZjg9GTocK+ITAMZ9wIumE9cyDJ
c980lITL+KQGi9EEiZDqJdea+TplOLAfy18MrH2DMY8KHItkHmL2U1W8qw4PZiWG
kLesMMJYf49soCIxkTqfno54Kl+GsNXAxmXi6nASUf/4lo20S8c/olYNgfvvf1+9
CLm7Eh2h3Ntsf0j5ECJqseCFqH+7DhAd7visRXqLkuUPSjKNbQTRi/bpSysXVehK
2u5ftdnda5FQfDxAwVBbPXIcyo/w428aWXeq4SFVt/v0j5p8jaeCJneRWVlKxkpp
XgQeAhwNT8995A5/cPGtYV+I7Y61c/UbhJpeuC301REh
-----END PRIVATE KEY-----

DSA ๊ฐœ์ธํ‚ค์—์„œ ๊ณต๊ฐœํ‚ค ์ถ”์ถœ

openssl pkey -in dsaprivkey.pem -pubout -out dsapublic.pem

์ƒ์„ฑ๋œ DSA ๊ณต๊ฐœํ‚ค

-----BEGIN PUBLIC KEY-----
MIIDQzCCAjYGByqGSM44BAEwggIpAoIBAQDPdv8PGpoPo1ZrSrbeODdInwH8g/Jx
ibtgKXIwSHs4ipSGvRxyTGb4miyZyoP9L68QetpAUIXTmyF1ZWMOJjV7LEKjpL00
6CaQOxRMscUj/mXDgp/5y6Z13gWQyWMqZIPJvKaDU06CDBUxCNsngthL7fmeS2Mv
AYhbGjTomPO3bQBgJalGQmgmYtfXHZ225rUEWB2GFaKfGU81E0tW0tNwu0+DHXpO
5g/00rYy8tKcnIu4Be1da5N6Ee8MbP9ODJ5QLWrC3JB4OoZPBb70G+yO0d/CLiIx
kHqx+mzF20nm4uubpUaU6FlTG0CoYvIZs49dzfDT5IbDmnGtXCFZbdfNAh0AlEWr
XY3r2SUGSFNzW8XjcR9eI8xvbsnXCLnsowKCAQEAj8VdHKmqhbt59tuBwtptMsFJ
AC3vJtQoj995uqTdaq4zpGVrqaz/uyomqeZjg9GTocK+ITAMZ9wIumE9cyDJc980
lITL+KQGi9EEiZDqJdea+TplOLAfy18MrH2DMY8KHItkHmL2U1W8qw4PZiWGkLes
MMJYf49soCIxkTqfno54Kl+GsNXAxmXi6nASUf/4lo20S8c/olYNgfvvf1+9CLm7
Eh2h3Ntsf0j5ECJqseCFqH+7DhAd7visRXqLkuUPSjKNbQTRi/bpSysXVehK2u5f
tdnda5FQfDxAwVBbPXIcyo/w428aWXeq4SFVt/v0j5p8jaeCJneRWVlKxkppXgOC
AQUAAoIBAHpQZbsrG64yfWDgXgjeaEG0fmmerLc1Wh0GV+A0gIl7Q9k6DIVgs7/W
OdFvUnqImks/N5Fb8Myx5Bc7+Med0qTvQmYnCX+fSIVjkCzev0riV+7nHOwlcIek
s+szxxlUm2w+4OTwJUFlHN5yhoK1Y/69VYbDfmavd6UdKjoWqjbA5JH6bLOFkagY
I/YsKQR3Zk16kpi6hlcZy0MHZUta6Rmt6RsL+manHgkCGHctaC0VKldFrAnBFJ2l
/3Ci26XH+9DIycYMsEjyfgYoRvhRgUti18l8wGDRxTGtaCXsRkIi5vrhdeNEyQEf
RZ9sokHwDz0LLXLSJKLQ+yEpOg9XEQk=
-----END PUBLIC KEY-----

DSA ๊ฐœ์ธํ‚ค๋ฅผ ์ƒ์„ฑ ํ•˜๋ฉด ๊ฐœ์ธํ‚ค ์•ˆ์— ํŒŒ๋ผ๋ฏธํ„ฐ ์ •๋ณด๊ฐ€ ํฌํ•จ ๋œ๋‹ค.
๋”์ด์ƒ ํŒŒ๋ผ๋ฏธํ„ฐ ํŒŒ์ผ์€ ์•ˆ๊ฐ€์ง€๊ณ  ์žˆ์–ด๋„ ๋œ๋‹ค.

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