Skip to content

Commit

Permalink
change key to ed25519
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Grubenmann committed Feb 24, 2023
1 parent be1722c commit 20bb664
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions renku/core/util/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
from pathlib import Path
from typing import NamedTuple, Optional, cast

from cryptography.hazmat.backends import default_backend as crypto_default_backend
from cryptography.hazmat.primitives import serialization as crypto_serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey

from renku.core import errors
from renku.core.session.utils import get_renku_url
Expand All @@ -40,10 +39,12 @@ def generate_ssh_keys() -> SSHKeyPair:
Returns:
Private Public key pair.
"""
key = rsa.generate_private_key(backend=crypto_default_backend(), public_exponent=65537, key_size=4096)
key = Ed25519PrivateKey.generate()

private_key = key.private_bytes(
crypto_serialization.Encoding.PEM, crypto_serialization.PrivateFormat.PKCS8, crypto_serialization.NoEncryption()
crypto_serialization.Encoding.PEM,
crypto_serialization.PrivateFormat.OpenSSH,
crypto_serialization.NoEncryption(),
)

public_key = key.public_key().public_bytes(
Expand Down

0 comments on commit 20bb664

Please sign in to comment.