Decrypting FileVault recovery key from fleetsmith - encryption

I'm trying to decrypt the dat file from fleetsmith. I have followed the steps (https://support.apple.com/pt-br/guide/fleetsmith/apd068558e73/web). Both files are inside the download folder, and the certificate is the right one.
but I'm getting this error:
openssl smime -decrypt -inform der \-in ~/Downloads/EncryptedFileVaultRecoveryKey_C02XH17HJG5H.dat \-inkey FleetsmithFileVaultKeyEncryptionPrivateKey_SOAH1FL8.pem \> FileVaultRecoveryKey.txt
Error opening signing key file FleetsmithFileVaultKeyEncryptionPrivateKey_SOAH1FL8.pem
4310681132:error:02FFF002:system library:func(4095):No such file or directory:/AppleInternal/Library/BuildRoots/b6051351-c030-11ec-96e9-3e7866fcf3a1/Library/Caches/com.apple.xbs/Sources/libressl/libressl-2.8/crypto/bio/bss_file.c:255:fopen('FleetsmithFileVaultKeyEncryptionPrivateKey_SOAH1FL8.pem', 'r')
4310681132:error:20FFF002:BIO routines:CRYPTO_internal:system lib:/AppleInternal/Library/BuildRoots/b6051351-c030-11ec-96e9-3e7866fcf3a1/Library/Caches/com.apple.xbs/Sources/libressl/libressl-2.8/crypto/bio/bss_file.c:257:
unable to load signing key file
```

Related

How can I convert .csr into .pem file format as I have to submit csr in pem format

I have to submit CSR in pem format.
I have generated CSR using OpenSSL but got stuck in converting it into PEM format.
I have to obtain example - csr.pem from example.csr. How it can be done?
OpenSSL creates CSRs in PEM format by default.
If you generated the CSR without the -outform option, the CSR will already be in PEM format.
If you did use the -outform DER option, you can convert with:
openssl req -inform DER -in <original CSR file> -out <converted CSR file>
The .pem file extension is just a name. If the file is in PEM format, simply change the extension on the file from .csr to .pem.

.crt to .p12 file conversion gives "unable to load certificates" error

I have a name.crt file i convert it using the following command
openssl pkcs12 -export -in name.crt -inkey name.key -out name.p12 -name "name".
I get the following error
unable to load certificates
but the name.p12 file gets generated which I am not able to use as it shows EOF when using with rest template.
I tried the process by removing ^M from name.crt file which again shows
unable to load certificates

How to decrypt a RSA encrypted .txt using a public key .pub file?

I was given an RSA encrypted .txt file to be decrypted and another .pub file to be used as a key to decrypt the same. I'm new to OpenSSL.
the FILES: https://www.dropbox.com/sh/j8581rdazdy0fxs/AABqsREMVMtDK53gtHQNYfkKa?dl=0
OpenSSL> rsa -noout -text -inform PEM -in key_5.pub -pubin
I executed the following command and got a hexdump of the key_5.pub file. (As attached)
The Modulus value is in hexadecimal form. How do I recover it in decimal form?
Or is there any other way to decrypt the orignal file?

Unix encrypt file using public .asc key

I have a file I need to encrypt with a public key I got public.asc. This key was shared with me over encrypted email. I have a zip file that I need to encrypt using this public key and share over SFTP.
I tried using openssl:
openssl rsautl -encrypt -inkey public.asc -pubin -in file.zip -out file.zip.enc
but openssl displays the flag options and no error message. Also, I'm suspecting that .asc files should be encrypted with some other software.
Thanks

How to decrypt smime.p7m file in DER format using OpenSSL in C code.

I am trying to decrypt emails using openssl.
I am getting smime.p7m file from the server. But it is in DER format.
I can decrypt this file using command prompt, with the command
openssl smime -decrypt -in openssl_working_smime.p7m -inform DER -inkey mycert.pem > dec_mail.eml
But now I want to do this using C code.
Right now I am trying to do using -
SMIME_read_PKCS7()
But this returns null with
SMIME_read_ASN1:no content type:asn_mime.c:451:
error
Any ideas how to do it?

Resources