SSH private key decryption. More...
Go to the source code of this file.
| Data Structures | |
| struct | SshKdfOptions | 
| KDF options.  More... | |
| Functions | |
| error_t | sshDecryptPrivateKey (const char_t *input, size_t inputLen, const char_t *password, char_t *output, size_t *outputLen) | 
| SSH private key decryption.  More... | |
| error_t | sshDecryptOpenSshPrivateKey (const SshPrivateKeyHeader *privateKeyHeader, const char_t *password, const uint8_t *ciphertext, uint8_t *plaintext, size_t length) | 
| OpenSSH private key decryption.  More... | |
| error_t | sshParseKdfOptions (const uint8_t *data, size_t length, SshKdfOptions *kdfOptions) | 
| Parse KDF options.  More... | |
| error_t | sshKdf (const char *password, size_t passwordLen, const uint8_t *salt, size_t saltLen, uint_t rounds, uint8_t *key, size_t keyLen) | 
| Key derivation function.  More... | |
| error_t | sshKdfHash (uint8_t *password, uint8_t *salt, uint8_t *output) | 
| KDF hash function.  More... | |
Detailed Description
SSH private key decryption.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2019-2025 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneSSH Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.5.4
Definition in file ssh_key_decrypt.h.
Function Documentation
◆ sshDecryptOpenSshPrivateKey()
| error_t sshDecryptOpenSshPrivateKey | ( | const SshPrivateKeyHeader * | privateKeyHeader, | 
| const char_t * | password, | ||
| const uint8_t * | ciphertext, | ||
| uint8_t * | plaintext, | ||
| size_t | length | ||
| ) | 
OpenSSH private key decryption.
- Parameters
- 
  [in] privateKeyHeader Private key header [in] password NULL-terminated string containing the password [in] ciphertext Pointer to the ciphertext data [out] plaintext Pointer to the plaintext data [in] length Total number of data bytes to be decrypted 
- Returns
- Error code
Definition at line 193 of file ssh_key_decrypt.c.
◆ sshDecryptPrivateKey()
| error_t sshDecryptPrivateKey | ( | const char_t * | input, | 
| size_t | inputLen, | ||
| const char_t * | password, | ||
| char_t * | output, | ||
| size_t * | outputLen | ||
| ) | 
SSH private key decryption.
- Parameters
- 
  [in] input Pointer to the encrypted private key (PEM or OpenSSH format) [in] inputLen Length of the encrypted private key [in] password NULL-terminated string containing the password [out] output Pointer to decrypted private key [out] outputLen Length of the decrypted private key 
- Returns
- Error code
Definition at line 61 of file ssh_key_decrypt.c.
◆ sshKdf()
| error_t sshKdf | ( | const char * | password, | 
| size_t | passwordLen, | ||
| const uint8_t * | salt, | ||
| size_t | saltLen, | ||
| uint_t | rounds, | ||
| uint8_t * | key, | ||
| size_t | keyLen | ||
| ) | 
Key derivation function.
- Parameters
- 
  [in] password Password [in] passwordLen Length password [in] salt Salt [in] saltLen Length of the salt [in] rounds Iteration count [out] key Derived key [in] keyLen Intended length of the derived key 
- Returns
- Error code
Definition at line 353 of file ssh_key_decrypt.c.
◆ sshKdfHash()
| error_t sshKdfHash | ( | uint8_t * | password, | 
| uint8_t * | salt, | ||
| uint8_t * | output | ||
| ) | 
KDF hash function.
- Parameters
- 
  [in] password Password [in] salt Salt [out] output Digest value 
- Returns
- Error code
Definition at line 473 of file ssh_key_decrypt.c.
◆ sshParseKdfOptions()
| error_t sshParseKdfOptions | ( | const uint8_t * | data, | 
| size_t | length, | ||
| SshKdfOptions * | kdfOptions | ||
| ) | 
Parse KDF options.
- Parameters
- 
  [in] data Pointer to the KDF options [in] length Length of the KDF options, in bytes [out] kdfOptions Information resulting from the parsing process 
Definition at line 314 of file ssh_key_decrypt.c.
