- 43
- 245 539
Cyber Hashira
Canada
Приєднався 13 чер 2022
Hi there!
I have setup this channel so I could share my knowledge about various cryptographic tools and topics related to Cryptography. I have 12+ years of experience with cryptographic tools such as Keytool, Signtool, OpenSSL, GPG etc. At the start of my career, it was really difficult for me to find relevant information about certain topics and the tools I was interested to learn about. Through this channel, I wish to bring everything I learned from my experience to everyone. I do my research and test everything to make sure that the knowledge I share is accurate and is as up to date as possible.
So what are you waiting for? Please watch some of my videos. If you like my content then please don't forget to leave a like and support me by subscribing to my channel. Thank you very much !
I have setup this channel so I could share my knowledge about various cryptographic tools and topics related to Cryptography. I have 12+ years of experience with cryptographic tools such as Keytool, Signtool, OpenSSL, GPG etc. At the start of my career, it was really difficult for me to find relevant information about certain topics and the tools I was interested to learn about. Through this channel, I wish to bring everything I learned from my experience to everyone. I do my research and test everything to make sure that the knowledge I share is accurate and is as up to date as possible.
So what are you waiting for? Please watch some of my videos. If you like my content then please don't forget to leave a like and support me by subscribing to my channel. Thank you very much !
Cryptography : Post Quantum Cryptography (PQC) - Are we ready?
#cryptography #pqc #postquantumcryptography #quantumcomputing
This video provides a high-level overview of Post-Quantum Cryptography. I explain what PQC is and why it’s so important, as well as the steps NIST has taken to prepare for the risks posed by quantum computing.
csrc.nist.gov/projects/post-quantum-cryptography
csrc.nist.gov/Projects/post-quantum-cryptography/workshops-and-timeline
This video provides a high-level overview of Post-Quantum Cryptography. I explain what PQC is and why it’s so important, as well as the steps NIST has taken to prepare for the risks posed by quantum computing.
csrc.nist.gov/projects/post-quantum-cryptography
csrc.nist.gov/Projects/post-quantum-cryptography/workshops-and-timeline
Переглядів: 378
Відео
PKCS#11 Tutorial for Beginners | Video-13 : Finding Objects in a token
Переглядів 4627 місяців тому
#pkcs11 #softhsm In this video, you will learn how to find and reuse an existing object such as a key or a certificate from a token. You will learn about three new pkcs11 function used for finding objects in a token. Notes / Samples - cyberhashira.github.io/ github.com/CyberHashira/PKCS-11-Tutorials PKCS11 Manual - www.cryptsoft.com/pkcs11doc/STANDARD/pkcs-11v2-20.pdf Music from #Uppbeat (free ...
PKCS#11 Tutorial for Beginners | Video-12 : Message Digest
Переглядів 2987 місяців тому
#pkcs11 #softhsm This video teaches you how to use the PKCS#11 API for calculating hash. This video introduces five new functions in PKCS#11 dedicated to generating hash. There is no sample code review for this video but you can find the sample codes from the GitHub link below. Notes / Samples - cyberhashira.github.io/ github.com/CyberHashira/PKCS-11-Tutorials PKCS11 Manual - www.cryptsoft.com/...
OpenSSL Tutorial Video-14 | Quick CA - An OpenSSL based Certificate Authority
Переглядів 7098 місяців тому
#openssl #quickca #openssl3 #openssl tutorials This video is about a bash-scripted utility that allows you to set up an OpenSSL based two-tier certificate authority in just under two minutes or less. Hence the name "QuickCA". The bash script utilizes the OpenSSL utility to execute PKI-related tasks. Quick CA also contains scripts that enable you to issue, examine, and revoke certificates. Event...
PKCS#11 Tutorial for Beginners | Video-11 : Signing and Verifying Data.
Переглядів 6849 місяців тому
#pkcs11 #softhsm This video teaches you how to use the PKCS#11 API for signing data. It introduces eight new functions in PKCS#11 dedicated to signing data and verifying the signature. I will demonstrate how to use those signing functions using C code. Notes / Samples - cyberhashira.github.io/ github.com/CyberHashira PKCS11 Manual - www.cryptsoft.com/pkcs11doc/STANDARD/pkcs-11v2-20.pdf Video Ti...
PKCS#11 Tutorial for Beginners | Video-10 : Encrypting and Decrypting Data.
Переглядів 71310 місяців тому
#pkcs11 #softhsm2 #softhsm #hsm #encryption This video guides you on utilizing the PKCS#11 API for encryption. Learn about eight new functions in pkcs11 dedicated to encrypting and decrypting data. I'll demonstrate through C code how to perform encryption using both Symmetric and Asymmetric algorithms. Notes / Samples - cyberhashira.github.io/ github.com/CyberHashira PKCS11 Manual www.cryptsoft...
PKCS#11 Tutorial for Beginners | Video-9 : Using Random Number Generators
Переглядів 608Рік тому
#pkcs11 In this video, you'll discover how to utilize the PKCS#11 API to generate random data. The two functions you'll learn about are C_GenerateRandom and C_SeedRandom. www.cryptsoft.com/pkcs11doc/STANDARD/pkcs-11v2-20.pdf github.com/CyberHashira/PKCS-11-Tutorials Video Timelines - 0:00 - Intro. 0:24 - What is RNG? 1:21 - Applications of RNG? 3:22 - Types of RNGs. 4:24 - C_GenerateRandom. 5:3...
PKCS#11 Tutorial for Beginners | Video-8 : Generating Keys
Переглядів 1,7 тис.Рік тому
#pkcs11 In this video, you'll discover how to utilize the PKCS#11 API to generate keys. We'll delve into the functions C_GenerateKey, C_GenerateKeyPair, and C_CreateObject within PKCS#11. The sample codes used in this video will illustrate key generation for DES-3, AES, RSA, ECDSA, and Data objects. www.cryptsoft.com/pkcs11doc/STANDARD/pkcs-11v2-20.pdf github.com/CyberHashira/PKCS-11-Tutorials ...
Cryptography | FIPS 140 - from Past to Present
Переглядів 1,9 тис.Рік тому
#fips #fips140-2 #fips140-3 Federal Information Processing Standards (FIPS). Want to learn about FIPS-140? This video starts with the basics of FIPS and then dives into FIPS 140. I discuss its history, FIPS 140-3, and how FIPS certification works. Like what you see? Give it a thumbs up and don’t forget to subscribe. Got questions? Just ask in the comments!" Timelines - 0:00 - Intro 0:37 - What ...
OpenSSL Tutorial Video-13 | Configuring Providers in OpenSSL 3.x
Переглядів 3,1 тис.Рік тому
#OpenSSL #OpenSSL3 This video focuses on OpenSSL providers, a new concept introduced in OpenSSL 3. I will discuss the new architecture implemented in OpenSSL 3 and provide a step-by-step guide on building OpenSSL 3 from source with the FIPS module on both Windows and Linux platforms. Additionally, I will demonstrate how to configure the FIPS provider in OpenSSL 3. Reference links - www.msys2.or...
PKCS#11 Tutorial for Beginners | Video-7 : Return Codes
Переглядів 1,2 тис.Рік тому
#PKCS11 This video focuses on return codes used in PKCS#11. Return codes in PKCS#11 are used for handling technical problems, understanding what caused it, debugging and troubleshooting those issues. There are a total of 66 return codes listed in the PKCS #11 manual, I have selected 34 return codes which I believe are some of the common ones. www.cryptsoft.com/pkcs11doc/STANDARD/pkcs-11v2-20.pd...
PKCS#11 Tutorial for Beginners | Video-6 : Attributes and Templates
Переглядів 1,5 тис.Рік тому
#PKCS11 This video focuses on attributes used in PKCS#11. I will provide an explanation of commonly used attributes in PKCS#11. Since attributes and templates play a crucial role throughout this tutorial, the concepts I teach here will greatly assist in understanding the topics discussed in my upcoming videos. www.cryptsoft.com/pkcs11doc/STANDARD/pkcs-11v2-20.pdf github.com/CyberHashira/PKCS-11...
PKCS#11 Tutorial for Beginners | Video-5 : Slots and Tokens
Переглядів 2,7 тис.Рік тому
#PKCS11 This video focuses on slots and tokens in PKCS#11. You will gain insights into two new PKCS#11 functions: C_GetSlotInfo and C_GetTokenInfo. Additionally, you will learn the proper usage of C_GetSlotList. For detailed notes and sample code related to this video, please follow the link provided below. github.com/CyberHashira/PKCS-11-Tutorials www.cryptsoft.com/pkcs11doc/STANDARD/pkcs-11v2...
PKCS#11 Tutorial for Beginners | Video-4 : Writing PKCS#11 code using C++
Переглядів 3,8 тис.Рік тому
#PKCS11 This video focuses on writing C code that utilizes the PKCS#11 API. It demonstrates a sample PKCS#11 code that utilizes functions such as C_GetFunctionList, C_Initialize, C_OpenSession, C_Login, C_Logout, C_CloseSession, and C_Finalize. Having a basic understanding of C would be beneficial in comprehending the sample code. However, even if you are not familiar with C programming, the en...
PKCS#11 Tutorial for Beginners | Video-3 : Getting Started with PKCS11 API
Переглядів 4,6 тис.Рік тому
#PKCS11 #hsm #HardwareSecurityModule In this third PKCS#11 tutorial video, we will delve deeper into the PKCS#11 API. I will provide explanations of various data types, structures, and functions defined in PKCS#11. The upcoming videos will feature demonstrations of PKCS#11 using C and C code. The content of this video contains fundamental concepts that are essential for understanding the topics...
PKCS#11 Tutorial for Beginners | Video-2 : SoftHSM
Переглядів 8 тис.Рік тому
PKCS#11 Tutorial for Beginners | Video-2 : SoftHSM
PKCS#11 Tutorial for Beginners | Video-1 : Introduction
Переглядів 14 тис.Рік тому
PKCS#11 Tutorial for Beginners | Video-1 : Introduction
OpenSSL Tutorial Video-12 | Key formats used in OpenSSL
Переглядів 2,2 тис.Рік тому
OpenSSL Tutorial Video-12 | Key formats used in OpenSSL
OpenSSL Tutorial Video-11 | CMS using OpenSSL
Переглядів 2,5 тис.Рік тому
OpenSSL Tutorial Video-11 | CMS using OpenSSL
Cryptography : Public Key Cryptography Standards explained.
Переглядів 2,8 тис.Рік тому
Cryptography : Public Key Cryptography Standards explained.
OpenSSL Tutorial Video-10 | Forks of OpenSSL (LibreSSL and BoringSSL)
Переглядів 1,5 тис.Рік тому
OpenSSL Tutorial Video-10 | Forks of OpenSSL (LibreSSL and BoringSSL)
OpenSSL Tutorial Video-9 | Setting up two-tier CA (Certificate Authority) using OpenSSL
Переглядів 6 тис.2 роки тому
OpenSSL Tutorial Video-9 | Setting up two-tier CA (Certificate Authority) using OpenSSL
OpenSSL Tutorial Video-8 | Introduction to OpenSSL Engines
Переглядів 3,7 тис.2 роки тому
OpenSSL Tutorial Video-8 | Introduction to OpenSSL Engines
Cryptography : What are Hardware Security Modules (HSM)?
Переглядів 11 тис.2 роки тому
Cryptography : What are Hardware Security Modules (HSM)?
OpenSSL Tutorial Video-7 | Generating Digital Certificates using OpenSSL
Переглядів 8 тис.2 роки тому
OpenSSL Tutorial Video-7 | Generating Digital Certificates using OpenSSL
OpenSSL Tutorial Video-6 | HMAC and CMAC using OpenSSL
Переглядів 4,1 тис.2 роки тому
OpenSSL Tutorial Video-6 | HMAC and CMAC using OpenSSL
OpenSSL Tutorial Video-5 | Generating Digital Signatures Using OpenSSL
Переглядів 6 тис.2 роки тому
OpenSSL Tutorial Video-5 | Generating Digital Signatures Using OpenSSL
OpenSSL Tutorial Video-4 | Generating Key Pairs using OpenSSL
Переглядів 9 тис.2 роки тому
OpenSSL Tutorial Video-4 | Generating Key Pairs using OpenSSL
OpenSSL Tutorial Video-3 | Encryption using OpenSSL
Переглядів 16 тис.2 роки тому
OpenSSL Tutorial Video-3 | Encryption using OpenSSL
OpenSSL Tutorial Video-2 | Verifying integrity using OpenSSL.
Переглядів 16 тис.2 роки тому
OpenSSL Tutorial Video-2 | Verifying integrity using OpenSSL.
openssl genrsa -aes-256-cbc command at ua-cam.com/video/VCDIpq84gVA/v-deo.html generates encrypted key stored in rsa.pri.enc file. But I guess you havent encrypted private key using this encryption key.
openssl genrsa -aes-256-cbc would generate an encrypted private key. The content of rsa.pri.enc is encrypted using the key derived from the passphrase.
Very usefull. Is it possible to build Oqsprovider integrated too? I keep trying, but... I don't think I can find oqsprovider in built openssl TT
OpenSSL does not include OQSProvider. I made a video introducing PQC, I'm working on a follow up video, which will eventually lead to a video on OQSProvider. Target: Jan/2025.
@@CyberHashira Thank you for your reply. I'll be waiting for your content. I hope it comes out soon ^^.
What does it mean that token is not initialized?
it simply means token is not ready for use.
@@CyberHashira Is it on token to decide when it is ready to be used? And then token should internally set it initialized?
@@michanowinski9361 Token is ready to be used when it has been initialized. Initializing a token involves setting a label and pins for SO and USER role. A uninitialized token does not have SO/USER pin set, which means there's no way to authenticate, and use that token.
@@CyberHashira So, as far as I understand, there is no way to 'create' not existing slot/token via C_InitToken if, for example, C_InitToken is called with not existing slotId? This slot must be already present with token available.
Nice video... just one question... you mentioned that when the openssl cms -encrypt command is run without entering any secret key, then a random key is generated at run time for encrypting the message using the chosen cipher, how does the recipient learn about this random key in order to be able to successfully decrypt the message content ?
That's what envelop is all about. Secret key used for encrypting the message is also encrypted and put in the envelop along with the encrypted message. Recipient's private key is used to decrypt the secret key.. and if successful, the secret key decrypts the message.
Sorry , I am a bit new to OPENSSL and engines, @9:05 , during the verification, you didn't update the URL of the public key to incorporate "type = public" , yet it still verified the signature as OK,does that mean that we just need to make sure that the object type is set to rsa-pub for verification ?
Yikes!, I didn't notice that. You're right, type should have been public.. not private. I believe the reason why verification still worked was because it read the public key modulus from the private key, else I'd expect failed signature verification.
Upon further inspection using debug logs, the PKCS#11 engine appears to be ignoring the "type" option. It searches for the public key and reads its modulus. This modulus is later used by OpenSSL to verify the signature. My initial assumption that PKCS#11 reads the modulus from the private key was incorrect.
Thanks for your valuable effort
you're welcome!
Very good tutorial. An additional video would be nice which explains how to setup a complete CA with the HSM.
Thanks! I agree, setting up a Certificate Authority (CA) with keys secured within an HSM is an interesting topic for a video. However, it’s not going to be an easy task. There are many different HSM vendors, each with its own way of setting up a CA. Additionally, there are various CA programs to consider, such as MSCA, OpenSSL, EJBCA, and StepCA. Nevertheless, I'll find a way... thank you.
Thanks for the effort!!!
you're welcome!
We have the first Bitcoin replacement Tidecoin(TDC) in NIST with PQC in the Quantum Era. At least US$760million Bit Password Lost Purse will be released. Let's prepare for a new era. Start mining. I recommend storing 1,000 each in your wallet.
Absolutely amazing video specially in days where crypto science is getting somewhat rare. I am using opensc with IsoApplet along with openssl pkcs engine. I am really struggling to get pkcs engine to work with openssl 3 on windows. Does openssl 3 support pkcs engine on windows or this must be done on Linux? Secondly for using engine, can I still use openssl3 or there is some version limitation to using version 1x, If you have a GitHub or tag on stack overflow would love to ask you more derailed questions that community could also benefit.
Another great video, thank you
Thank you very much!
We have the first Bitcoin replacement Tidecoin(TDC) in NIST with PQC in the Quantum Era. At least US$760million Bit Password Lost Purse will be released. Let's prepare for a new era. Start mining. I recommend storing 1,000 each in your wallet.
Nice work, thank you
You're welcome!
For encryption, there's a great feature: you can use multiple -recip arguments, each with its own certificate. This means that anyone with the corresponding private key can decrypt the file. Imagine you're encrypting backups (because you're smart and store them with a third party, but don’t trust them, so you encrypt the backups). Now, what if one of the people managing the encryption leaves, and you don’t have their key? By encrypting with multiple certificates (each belonging to a different person), any one of them can decrypt the file. Technically, the file is encrypted using a single random key (which is relatively short, just a few bytes), but this key is attached to the file multiple times-each version encrypted with a different public key from the corresponding certificates. So, someone whose certificate was used for encryption can decrypt one of the encrypted keys, and then OpenSSL will use that key to decrypt the actual data.
Very useful comment, Thanks for sharing!
How would you generate a Code Signing certificate?
I'd refer you to my video about digital certificate.. You need to specify key usage and extended key usage for code signing.. watch that other video for more info.. thank you.
supper clear. I try to understand keystore with many other documents but your video help me a lot. Keep you great work.
Thank you very much!
Hi, Thanks a lot for this PKCS11 Tutorial. It is very helpful. I tried to run the connect_disconnect_windows application against a Luna HSM (by pointing to the Luna library, but I receive the error message: Failed to load P11 library. "c:\Program Files\SafeNet\LunaClient\cryptoki.dll". The library is found but it is not being loaded?
Hi, Thanks for posting this comment. The executable you get after compiling connect_disconnect_windows.cpp file, is it 32 bit or 64 bit? I try to test my sample using Luna HSM. Will post an update soon.
update: sample worked with Luna HSM.
@@CyberHashira How to verify that the produced application is 32bit or 64bit?
@@sergioeaeapp check the list of OS under compatibility mode to see if any old Windows OS such as Win 98, Win Xp is listed.
@@CyberHashira Thanks for the answer. It does not have checked the compatibility feature.
it is possible to create a keystore without password
not possible if you're using keytool to create a keystore. Why do you want you want create a keystore without password?
@@CyberHashira actually our client hsbc needed it
@@CyberHashira Is there any tool to create it password less ?
@@subhrajitsaha233 I don't think so.. May using a programmatic approach but I have never tried it Why can't they use a password?
@@CyberHashira Exactly sir we just raise this point only
sir can you make video on real time use cases video on tls certificates like in vmware vsphere cloud or aws cloud..its a humble request
Sure.. I'll consider this as part of my future content.
Nice video and good content
Thank you so much 😀
I gained a lot of info off your videos so far. I do have 1 question for you. On generating a certificate (27:00), what's the syntax that I need to use to generate a CA CSR without using a config file?
What do you mean by "CA CSR"? A CSR that a trusted CA will use to generate a certificate or a CSR with CA extension set? CSR with CA extension : openssl req -new -subj "/CN=Test" -key <private_key_file> -addext "basicConstraints=CA:true" -out test.csr Remove -addext "basicConstraints=CA:true" if you need a standard CSR.
@@CyberHashira Thanks for this info. I'm trying to create a 15 year validity CA cert at work through openssl. So that's why I need to create that csr and create a CA cert signed by the root with a 15 year validity.
@@CyberHashira I'll try it out during the week, thanks
@@rellirel82 Sure. By the way, I do have a bash scripted utility that uses OpenSSL to automate creation of CA (2-tier). You might want to check out "QuickCA" project from my github. I use it for my testing and I think you'd find it useful too!
pkeyutl finally grew a -digest switch in OpenSSL 3 to automatically compute the hash of a large input prior to signing it, which is useful to cut out one extra step.
Great! OpenSSL gets updated with new features and option with every update.. I guess it's time to update my videos as well. haha.. Thanks for commenting!
Very good video. It would have been nice if you had explained a proper ca singed cert not just local system ca root
Thank you. I don't think it makes much difference whether I use a Private or a Public CA signed certificate. Public CA code signing certs are not free and they certainly are not cheap.
I got a certificate Authority and managed to configure the template and PKCS as per the company requirements. It's been working for almost a year with all platforms "Android, Windows, macOS." Everything seemed to be fine until we tried to enroll new macOS devices at the beginning of July. We noticed that the certificate policy doesn't work only with macOS devices. We checked Intune reports and found that everything works well in terms of deploying the policy, but it comes up with an error with no codes. We reviewed the root certificate on the app school manager, and it seems fine. The certificate type is: device. The subject alternative name: UPN. This problem takes place on just the new macOS devices as the oldest ones work well. Any insights?
This is GREAT! It's so easy to find brief outlines PKCS11 at a high level but so difficult to find anything with the nuts and bolts of how it works. Subscribed.
Thank you very much, cheers!
Dear We want to do Oracle R12.2 EBS file jarsinig using the HSM option, please help me the process or steps
Check out the video titled "Java Cryptography : Signing JAR files using Luna HSM." on this channel.
Thank you, very good job!
You're welcome!
@@CyberHashira Thank you so much for your response to my compliment. I really appreciate the content you create, and I’d like to suggest a topic for future videos. Would you consider making a video about PDF signing? I think many of us would find it very valuable to understand the process better, especially regarding security and best practices. Thank you for your attention and for the excellent work!
@@devmenezes I always respond to every comment made to a video. 🙂 Thanks for writing! ..and Yes, I'll surely include your suggested topic as one of my future content. Cheers!
how to add providers in openssl.conf file on windows
Same as you do it on Unix/Linux..
You told us in Video 3 that RSA asymmetric encryption algorithm is very limited when it comes to the size of the targeted file. It can encrypt only a file with the size of the same number of bytes of its private key minus 11 bytes. Here in Video 4 you converted the format of the RSA key files from readable base64 formate (pem format) to binary format (DER format) and introduced 2 more asymmetric encryption algorithms, the DSA encryption algorithm and the ECDSA algorithm. But you did not tell us which algorithm we can use to encrypt a large size file asymmetrically (with private/public key pair)?
You don't use asymmetric keys to encrypt/decrypt large files.. you should either use secret key or hybrid (asymmetric + symmetric).
A lot of information in this video. Thank you for that Here are important notes because it is difficult to remember and it can be confusing: 1 --- To generate RSA private key: genrsa To generate DSA private key: gendsa But to generate ECDSA private key, you do NOT write genecdsa a expected. You write ecparam -genkey 2 --- To generate DSA private key: you pass the name of the parameter file WITHOUT -in But to generate ECDSA private key: you need to pass the name of the parameter file with -in 3 --- To generate ECDSA private key with parameter file saved on your hard drive: you write -in before the name of the parameter file But to generate ECDSA private key you WITHOUT parameter file saved on your hard drive: you write -name before the name of the parameter file 4 --- To generate ECDSA private key: you write ecparam But to generate ECDSA public key: you write ec 5 --- You can encrypt the private key of RSA and DSA when you are generating them But for ECDSA you have to generate the private key first then encrypt what you have just generated. To do that you need either to pipe or to do the encryption in a separate following command line
I did provide a github link in the description with notes for all of my OpenSSL related videos.
@@CyberHashira You are a good teacher. Teach us Python or anything from scratch (for beginners who are ready to commit time and effort).
@@HutS-e5c may be some day, I'll try..although I'm not a python expert..
If the size of the private key generated by (openssl genrsa) is 2048 bit which is 256 bytes which means 256 characters, then why (openssl genrsa | wc) gives us 1704 characters?
because it's PEM encoded (Base64)..
@@CyberHashira I followed the video encrypting with the RSA public key and decrypting with the RSA private key and it worked fine. But when I tried to encrypt with the private RSA key, I was not able to decrypt with the RSA public key.
@@HutS-e5c Private keys are not used for encrypting. I highly recommend that you learn the fundamentals of cryptography before diving into OpenSSL.
@@CyberHashira Would you please recommend a source for me to learn the fundamentals of cryptography?
@@HutS-e5c google
Dose the encrypted file with a password (to produce Earth.enc file) include the hashed password in the header of the file so when I take it to a different computer or send it to someone, it can be decrypted on that new computer with the correct password? If so then I want to see that hashed password in Earth.enc. How can I do that? I want to see also in the header of the Earth.enc the random salt that was used when you added -pbkdf2.
encrypted file contains encrypted data and nothing else.
@@CyberHashira So how would openssl tool know if I do not entered the correct password or if I do not enter the correct -pbkdf2 flag or if I do not enter the correct number of -iter and as a result of that it writes to me an error message? Also, how does openssl know what random salt was used so when I want the openssl tool to remove the encryption for me, it adds that exact salt to the password that I enter (at the time I want to remove the encryption) and hash them together the correct number of times to decrypt the file for me? By the way, I found online that -pbkdf2 is called "Password Based Key Derivation Function 2" --- "Function" instead of "Format".
@@HutS-e5c openssl utility would expect the user to enter all required information correctly; failed cryptographic operations would return an error.
@@CyberHashira How the openssl utility get to know that the decryption failed to show me an error message? It is not a human. It would not know the difference between text that has meaning (to determine that the operation has succeeded) and gibberish (to determine that the operation has failed).
@@HutS-e5c padding scheme checks after decrypt is one way to see if decrypt was successful.
You do not explain the meaning of: the exponent used in creating the private key, the modules the exponent and the 2 prime numbers, the coefficient that appear when you examine the private key the difference between digest-algorithms and cipher-algorithms
That's because the focus of this video is OpenSSL. I don't want to make a lengthy video covering every fundamental aspect, as there are plenty of other online resources available for that. If you're unfamiliar with terms like digests and ciphers, it might be helpful to start with those before diving into OpenSSL.
Thanks for making this video. Very useful. I had a query though. I see you have suggested using base provider with FIPS because it has non cryptographic algos which Fips does not. But it contains a only small sub-set of non-cryptographic algorithms available in the default provider. What will happen if we use default and the fips provider together ? Since both of them implement cryptographic algos, which one will get preference at run time? I am thinking about the algos which are common in both
Excellent question! "Default", as the name implies, is the default provider for OpenSSL. So, if you try to generate an RSA key pair while both the default and FIPS providers are configured, the default provider will be loaded. If you want to achieve true FIPS security restrictions, then the FIPS and BASE providers are the ideal options.
@@CyberHashira Thank you. I will try that.
Excellent Video! Great job on explaining everything clearly-Thanks alot!
You're welcome!
An introduction to PKCS in this video is a good starting point, well explained. Thanks!
Glad you found this video to be helpful..
Very well explained
Thank you.
This is what i'm looking for!
Hi, I am having this error : g++: error: connect_disconnect.cpp: No such file or directory. How did you put the connect disconnect together with the include file in the beginning? seems like I need to have it first. Thank you
"no such file or directory" means g++ did not find connect_disconnect.cpp. Execute this command in from the directory where that file exists.
@@CyberHashira I do not have that file tho, where can I find it or how do I make it? I only have the include file and do not have the connect disconnect file like you have on the beginning of your video... pls help
@@thechuckydoll there should be a github link in the description. github.com/CyberHashira/PKCS-11-Tutorials Find it in the samples directory.
@@CyberHashira thank you, I finally got it now I was just doing the wrong thing. thank you!
@@thechuckydoll You're welcome!
Thanks for a nice video. When I tried to load softhsm module, I am getting the error. Can you please help me to resolve it. (I am using macbook pro M1) #pkcs11-tool -I Cryptoki version 3.0 Manufacturer OpenSC Project Library OpenSC smartcard framework (ver 0.25) No slots. #softhsm2-util --show-slots Available slots: Slot 268806978 Slot info: Description: SoftHSM slot ID 0x1005ab42 Manufacturer ID: SoftHSM project Hardware version: 2.6 Firmware version: 2.6 Token present: yes Token info: Manufacturer ID: SoftHSM project Model: SoftHSM v2 Hardware version: 2.6 Firmware version: 2.6 Serial number: 0d3bd6569005ab42 Initialized: yes User PIN init.: yes Label: HSM_Token_01 Slot 1 Slot info: Description: SoftHSM slot ID 0x1 Manufacturer ID: SoftHSM project Hardware version: 2.6 Firmware version: 2.6 Token present: yes Token info: Manufacturer ID: SoftHSM project Model: SoftHSM v2 Hardware version: 2.6 Firmware version: 2.6 Serial number: Initialized: no User PIN init.: no Label: #pkcs11-tool --list-slots --module /usr/local/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so sc_dlopen failed: dlopen(/usr/local/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so, 0x0001): tried: '/usr/local/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so' (no such file), '/usr/local/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) error: Failed to load pkcs11 module Aborting.
The error self-explains what the issue is.. You're trying to use binaries built for x86_64 hardware. Mac M1, M2, and M3 uses arm. Not sure how you installed those packages, I use homebrew.
@@CyberHashira Thank you for your reply. I also used Homebrew to install it (as shown in the log below). According to the information published on Homebrew's official website, this application supports Apple's M chip architecture. However, I am not sure if the version I installed is indeed the version for Mac M1. If you know a way or have any ideas on how to check and fix this error, please let me know. I would be extremely grateful and appreciative! --------------------------------------------------------- #brew install softhsm ==> Auto-updating Homebrew... Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). ==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask). ==> New Formulae chkbit cyme egctl envelope h26forge kubevpn lando-cli mako otree porter qrtool subliminal topfew ==> New Casks airdash font-afacad-flux font-big-shoulders-stencil-display-sc font-gulim lazycat positron ball font-batang font-big-shoulders-stencil-text-sc font-gulimche monokle productive blip font-batangche font-big-shoulders-text-sc font-gungsuh navicat-premium-lite retroarch-metal@nightly charmstone font-big-shoulders-display-sc font-dotum font-gungsuhche orka-desktop wd-security clash-verge-rev font-big-shoulders-inline-display-sc font-dotumche inkdown pia yaak ea font-big-shoulders-inline-text-sc font-fragment-mono-sc k8studio plugdata@nightly You have 37 outdated formulae installed. ==> Downloading ghcr.io/v2/homebrew/core/softhsm/manifests/2.6.1-2 ############################################################################################################################################################################################################################################ 100.0% ==> Fetching softhsm ==> Downloading ghcr.io/v2/homebrew/core/softhsm/blobs/sha256:2883177ca802dcf95f7fe8eaf5118399eaab1c6cf1e1d3f2d8b4a6771708f2d7 ############################################################################################################################################################################################################################################ 100.0% ==> Pouring softhsm--2.6.1.sonoma.bottle.2.tar.gz 🍺 /usr/local/Cellar/softhsm/2.6.1: 17 files, 2.6MB ==> Running `brew cleanup softhsm`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). --------------------------------------------------------- ---------------------------------------------------------
I have just found a solution to my issue: 1. add alias to startup script: alias armbrew="arch -arm64 /opt/homebrew/bin/brew" alias x86brew="arch -x86_64 /usr/local/bin/brew" 2. then can use armbrew install softhsm opensc
@@olesport7536 Good to know..
hi, what is the path of pkcs11? I'm having error when entering it it's 'pkcs11' is not recognized as an internal or external command, operable program or batch file. pls helppp thank you
Well, it depends on where and how you installed that program. Find where the executable is and update the path. By pkcs11, i'm assuming you mean pkcs11-tool.
Thank you for these nice videos!
You're welcome!
can you demonstrate in java if possible do complete softHSM and Openssl pkcs11 in java to generate key and store key and certficate creation
For Java, you'd have to use a pkcs11 security provider for Java such as SunPKCS11, IBMPKCS11, and IAIK. I would eventually cover these topics but not anytime soon.
@@CyberHashira implemented using SunPKCS11 but while configuring the PKCS11 file i face issue now it's cleared if you explain complete softhsm key generation and key storage using openssl tool it will help for so many students and learners who working on cryptography and softhsm thank you for replying and give hope to cover the topic in future
@@appu9588 Sure, you're welcome!
this video is very help full for my final project..thank you very much your explanation..
You're welcome and thanks for watching!
great explanation.
Thank you.
Hi. Thanks very much for the fantastic tutorial. You mentioned that using pbkdf2 approach is good cause the alg salt the password you enter (I did not see you enter the password -- I believe that you meant enc.key, didn't you?) You mentioned that 100k iterations are done and hash is calculated. I believe that the randomly choosing the one among the 100k is the reason for doing iterations. But in that case the decryption -- requiring the iter parameter exactly same as 100k does not make sense to me -- because it violates the randomness nature. I am writing this with the sole objective of learning. I really appreciate your work!!
Hello, you're welcome! Yes, 'enc.key' is a file containing the data that will be used as an input by PBKDF2, to derive an encryption key. I generated it using 'openssl rand -out enc.key 32'. The encryption key is not picked randomly from 100k iteration; it is the final result of 100k iterations.Therefore, changing the number of iteration would result in a different key value, causing decryption to fail. I hope this clear any doubts. good question 🙂 I appreciate you taking time to watch my content.
@@CyberHashira Pleasure watching your series :) Just a quick question then -- how does iteration really impact the procedure? I mean -- how come 100k is better than just 10 iteration?
@@BhavinMoriya-i8i Iteration is the number of times a PRF is executed on an input data in PBKDF2. The more iterations, the more scrambled the output becomes. NIST recommends a minimum of 1,000 iterations for PBKDF2 (SP 800-132). A higher number of iterations increases the difficulty of guessing, calculating, brute-forcing, or reassembling the output back to the original input. Imagine that I have a piece of paper with some secret information printed on it. Instead of giving you that paper as it is, I tear it into many pieces. Which one do you think would be more difficult to reassemble: paper torn into 10, 100, or 1000 pieces?
When you said "It has nothing to do with crypto currency" 🤣🤣🤣
lol, just so you know.. haha
Awesome content!
Thank you, you're awesome!
homebrew accidentally installed later version of openSSL which is not working for my Robot Automation tests. Is there is a way to downgrade to 1.1?
homebrew may have updated openssl to 3.x but I believe 1.1.1 should still exist somewhere in the file system. Assuming your homebrew home is /opt/homebrew, look inside /opt/homebrew/Cellar.. You should see openssl1.1 if not, try "brew reinstall openssl@1.1" and check again. you may have to then update that openssl path somewhere in your automation program. hope this helps!
. Using these providers can I build an implementation that will allow to use AWS KMS for signing as compared to using the openssl signing feature
Yes, I think it's doable, I've never tried AWS though. I know Azure Key vault has an OpenSSL engine. There is a similar engine for AWS Cloud HSM. You can write your own OpenSSL implementation to utilize AWS KMS.