Click here to Skip to main content
15,893,190 members
Everything / Security / Cryptography

Cryptography

cryptography

Great Reads

by Arpan Jati
RSA encryption library with full OAEP padding and private key encryption support
by Kewin Rausch
Design and development of a TOR-like protocol to keep your communication secure and your identity unknown
by Pavel Bashkardin
ARC4 (Alleged RC4) Cryptography Provider Class Library
by Cryptonite
The Blum Micali algorithm provides for a cryptographically secure PRNG (pseudo random number generator).

Latest Articles

by Daniel Ramnath
C++, Win32 API - Injecting DLL in a process
by Daniel Ramnath
C++ OpenSSL 3.1 Attack AES-CBC using Padding Oracle Attack, and Timing Attack
by Michael Chourdakis
Use SHA-3 and the CRYSTALS Kyber, Dilithium and Sphincs in Win32 projects
by Sergey Alexandrovich Kryukov
Generator of highly secure passwords based on cryptographic hash and master password, which should be memorized; no password storage is involved.

All Articles

Sort by Updated

Cryptography 

14 Apr 2024 by jv067i
Hello, I am taking the liberty of making a post on this site because I am encountering a problem using the LibSodium library, in JavaScript. The goal is to encrypt a message, so I execute: var i=sodium.crypto_secretbox_NONCEBYTES; var...
13 Apr 2024 by Andre Oosthuizen
You are generating the nonce incorrectly. Your 'sodium.randombytes_buf(i)' function expects the argument of 'i' to be the length of the buffer (in bytes) to be generated, not the actual value of the nonce length as per your code. The...
13 Apr 2024 by Graeme_Grant
It's a 3rd-party library. Best place is to ask in their issues on github: Issues · jedisct1/libsodium.js · GitHub[^]
20 Dec 2023 by Daniel Ramnath
C++, Win32 API - Injecting DLL in a process
9 Oct 2023 by HughJass24
As suggested by the title, I'm working on an exercise where I'm given a hash function H that takes in an input string x. I'm supposed to construct a distinguisher that proves H isn't collision-resistant. I'm given a block cipher F, F^-1 as well....
19 Aug 2023 by adriancs
I have just published an article exactly answered this question. I know my post it's a little late to the party, but anyway, here's my article. cheers AES Encrypted Data Transmission between Arduino (ESP32) and C# (ASP.NET)[^]
14 Aug 2023 by Daniel Ramnath
C++ OpenSSL 3.1 Attack AES-CBC using Padding Oracle Attack, and Timing Attack
13 Aug 2023 by Michael Chourdakis
Use SHA-3 and the CRYSTALS Kyber, Dilithium and Sphincs in Win32 projects
8 Aug 2023 by DrAibolit
Hi, I have a problem to format string to sign webrequest using SHA-256. I have an example code written on Pyton which works correct. I try to write the same on .Net but have no success with it. Thanks for any help! What I have tried: Imports...
8 Aug 2023 by DrAibolit
I found my mistake. I use vcCrlf to split plainText String.Join(vbCrLf, New String() But I need to use just vbLf instead. This mistake made my signed request corrupted.
21 Mar 2023 by LB2371
I'm implementing a CSRF protection system for my website (forms) and I've noticed a strange (?) thing using hash_equals + crypt. An example to explain it (PHP 8.1.8): $sessionToken = crypt(“562710df09d5b3b1e33769cd50a7e15d0cad770e66771ebbe9”,...
7 Jan 2023 by Nikhil Sisodia
Hi,I am seeing a strange behavior with CryptStringToBinary Cryptography API.Please see the below code (config: x64 Debug):#include "stdafx.h"#include #include #include #include void main(){ DWORD dwSkip; DWORD dwFlags; DWORD...
28 Dec 2022 by Sergey Alexandrovich Kryukov
Generator of highly secure passwords based on cryptographic hash and master password, which should be memorized; no password storage is involved.
22 Sep 2022 by Raphael Amorim
How to get plain text session using CryptoAPI
26 Jul 2022 by raddevus
C’YaPass (Fully Open Source Software) now a Fully-Functioning Password Ecosystem which doesn’t store your passwords anywhere — You are the owner of your data.
30 Jun 2022 by raddevus
Fully working sample code and explanation of everything necessary to create authenticated encryption with AES256.
8 May 2022 by Member 10494282
Hello, I need help. I'm trying to implement TLS1.3 on my server and I'm stuck importing a 2048-bit RSA private key. I want to import it from a .pem file. I manage to read it, then convert it from base64 to hex (binary) and I have it all in a...
8 May 2022 by Bruno Tabbia
Creation of a substitution box starting from a key and using it in a direct substitution cipher
5 May 2022 by Jerome Vonk
Description of cryptographic hashes and practical examples on how to calculate them
12 Apr 2022 by TempoClick
I am trying to create a GUID from a string that looks like this "ZgEKpwQbNswAAAFgf2R4ugv.". 24-character string => Guid, AND Guid => 24-character string The problem is that the string is 24-bytes array and to generate a GUID I need a 16-bytes...
12 Apr 2022 by CPallini
As it is stated, there is no way. You should make a compromise. For instance, you may keep three characters in the string fixed (or computable from the other ones). Or you might accept that the same GUID is mapped to many strings.
12 Apr 2022 by OriginalGriff
You are going to have to go back to where you got the data from and ask there - it's not obvious what encoding was used to generate that string. It looks like Base64, but that decodes to an 18 byte value: 66 01 0A A7 04 1B 36 CC 00 00 01 60 7F...
19 Feb 2022 by Asif Bahrainwala
A simple C++ program to generate RSA key pair
16 Feb 2022 by charles henington
Simple user defined Cipher Transform that I got the idea from https://www.codeproject.com/Articles/5319044/ARC4-Encryption-Library
10 Feb 2022 by Michaelred54
I get this error: "An object reference is required for the non-static field, method, or property 'HashAlgorithm.ComputeHash(byte[])'" on this code: protected void Button1_Click(object sender, EventArgs e) { ...
10 Feb 2022 by M Imran Ansari
In order to use a non-static field, method, or property, you must first create an object of an instance. HashAlgorithm hashAlgo = HashAlgorithm.Create("SHA512"); Now use the object hashAlgo to call their methods. Reference for more information:...
10 Feb 2022 by Tony Hill
Try this HashAlgorithm myHashAlgorithm = HashAlgorithm.Create("SHA512"); byte[] hash = myHashAlgorithm.ComputeHash(Encoding.UTF8.GetBytes(PIN_Entry.Text)); string MyHash = System.BitConverter.ToString(hash); ...
8 Feb 2022 by Pavel Bashkardin
ARC4 (Alleged RC4) Cryptography Provider Class Library
7 Nov 2021 by lfbr0
I'm currently doing an assignment for a college course using Java's JCA. The application takes in a file and encrypts it (or decrypts it) using DES-ECB. I am fully aware that it's not a secure encryption algorithm. It encrypts fine, I believe,...
25 Oct 2021 by ADMGNS
Very simple, noise-based color visual cryptography for images
20 Oct 2021 by sreeyush sudhakaran
I have tried many Examples in Google to PGP Encrypt my Text file , but all of them shows error in some or other ways.I tried the Encryption Tool https://www.igolder.com/PGP/[^] for testing my file.It only works fine in that website only.I hardly need help for 1)How to generate...
23 Aug 2021 by sonu Ranjan
I have an issue With multiple Digital Signatures in PDF Files using a USB Token. I am using open-source dll itextSharp for digital Sign and I am trying to multiple Sign in PDF File. In this scenario user (A) have sign a single page PDF File, and...
23 Aug 2021 by Richard Deeming
Changing a PDF file will invalidate any existing signatures on the file. That's the whole point of the signature.
5 Mar 2021 by Clark Fieseln
Low rate data exchange (e.g., chat) using audio steganography, ensuring privacy, anonymity and cybersecurity
4 Mar 2021 by DoingWork
Is System.Security.Cryptography.OpenSSL namespace works for Widnows? What I have tried: I want to implement security via OpenSSL starting from beginner stage.
4 Mar 2021 by Dave Kreskowiak
This took all of 20 seconds to find: Quote: Provides cryptographic algorithm implementations and key management for non-Windows systems with OpenSSL. NuGet Gallery | System.Security.Cryptography.OpenSsl 5.0.0[^] And on RSAOpenSsl Class...
25 Feb 2021 by DoingWork
Is OpenSsl available in Visual Studio in Windows OS ? I want to Encrypt test using OpenSSL in Visual Studio 2017. Then what is purpose of System.Security.Cryptograpgy.Openssl Nouget Packet in Visual Studio ? What I have tried: Here a link in...
25 Feb 2021 by #realJSOP
There are several OpenSSL-specific NuGet packages available. I don't know if any of them will meet your needs, but you can start looking in there.
7 Nov 2020 by RickZeeland
See remark here: Aes128.Encrypt Method (String, String, Mode, String)[^] For ECB and CBC modes, the length of the decoded input bytes must be an exact multiple of the block length (16 bytes). The examples seem to be for the CryptoSys...
7 Nov 2020 by Mr.H3
I want to use AES 128 ECB algorithm in securing message files. I have tried all the solutions available on the internet. But when I do manual calculations the results are different.Anyone have any code regarding this please share it with me that...
23 Sep 2020 by j11codep
If the Client Hello request is somehow intercepted before it gets to the real server and this malicious server replies with it's own certificate (not sure if this is possible, like maybe the malicious server has an actual valid certificate issued...
23 Sep 2020 by Richard Deeming
This would require the attacker to have a valid certificate for the domain they're trying to intercept. There are generally two ways this can happen: A rogue or compromised CA. This tends to be caught fairly quickly, and that CA will be booted...
19 Sep 2020 by Dave Kent 305
I was making some research on cryptography for a class when i got to this article talking about how the meet in the middle algorithm process can boost the processing time (computational time) of some math problems in python I.E Large Numbers. But...
19 Sep 2020 by Patrice T
Quote: Can i please have a proper explanation of the 'Meet in the middle' mathematical algorithm? In the article you provided, "meet in the middle trick" is itself a link to an explanation (thus the green color) with example. Meet in the middle...
15 Aug 2020 by vardhman shah
Hello, I have sample code in Java for your reference. public static String decryptOpenSSL(String key,String data) throws IOException, GeneralSecurityException{ OpenSSL opensll=new OpenSSL(); InputStream ...
15 Aug 2020 by Garth J Lancaster
"but not work for me" - that's a pretty useless description - why would you do openssl AES encryption in C# when the framework has it build in - Aes Class (System.Security.Cryptography) | Microsoft Docs[^]
17 Jun 2020 by OriginalGriff
Why on earth would you want to do that? "Rolling your own" with encryption is a good way to get problems later: it's a complicated field with complex code, and tiny differences can cause encrypted data to either be easily broken or corrupted...
17 Jun 2020 by AnasMHDAbbas
Hi friends, we know RSA key pair need p,q (prime numbers), and if we want to generate RSA key on 128 bit length we need to generate p and q on 128 bit length and do some math with them. my problem is how to generate these big prime numbers and...
13 May 2020 by Apprieu (Apprieu)
How to generate a serial key with Crypto API MFC
3 Apr 2020 by OriginalGriff
Don't do that. Instead, call hc.GetHashPassword on the password they tried to log in with, and compare that with the value stored in the DB. Provided the salts are the same - and if they aren't you'll never get a good match or it's a pathetic...
3 Apr 2020 by Member 14766911
I am following an example on how to create and verify a secured password with PBKDF2 which I found from this website What I have tried: I created a class called "HashCode" which I am accessing from the registration and login form and I am able...
27 Mar 2020 by Richard MacCutchan
OK, this is what it is: Base58Check encoding - Bitcoin Wiki[^]
27 Mar 2020 by Asish6542165
I have a function that returns a bitcoin address but I want to perform base58check encoding on it to convert it to a bitcoin address. unsigned char address[]="008f26a17cbbc941a9dbe63a1f1c69591f08aab94bd586ad5e" The address is stored in an...
23 Mar 2020 by steveb
Send me 1 million USD I'll hack it together
22 Mar 2020 by k5054
looking back at your original question, you had const unsigned char* rawdata = "046EAF0968AA895ADDFEE599566F0B880242461D1377F4887C9B84631E13067B96DB18C41E0C208F8D12EBCC3F99F2522903AF6105833E4CBADE9D6A1D0F039187"; unsigned long n =...
22 Mar 2020 by Asish6542165
just follow this link. SHA256 and RIPEMD160HASH in C program[^] when I replace const unsigned char* rawdata =...
22 Mar 2020 by steveb
when you are using an initialization list (your 2nd case) you need to change your declaration to: const unsigned char rawdata[] = { 0x04, 0x6E, 0xAF, 0x09, 0x68, 0xAA, 0x89, 0x5A, 0xDD, 0xFE, 0xE5, 0x99, 0x56, 0x6F, 0x0B, 0x88, 0x02, 0x42, 0x46,...
20 Mar 2020 by phil.o
const unsigned char* rawdata = "046EAF0968AA895ADDFEE599566F0B880242461D1377F4887C9B84631E13067B96DB18C41E0C208F8D12EBCC3F99F2522903AF6105833E4CBADE9D6A1D0F039187"; You've already been told that, but I am going to tell you once more: the rawdata...
20 Mar 2020 by Asish6542165
I wrote a c program to perform sha256 hash on a char array and then perform ripemd160 hash on the output of the sha256 hash function. here is my code: #include #include #include #include
20 Mar 2020 by Richard MacCutchan
const unsigned char* rawdata = ""; unsigned long n = strlen(rawdata); unsigned char md[32]; unsigned char* pmd = RIPEMD160(rawdata, n, md);
20 Mar 2020 by Asish6542165
I wrote a c program to calculate ripemd160 hash on a 64-byte char array.But it give me the wrong output. This is my code: #include #include #include int main (void) { unsigned char s[7] =...
20 Mar 2020 by CPallini
Quote: 31ed4989d15e4889e24883e4f050544c8d059a01 If that is the hexadecimal string representation of an array of bytes then you should do something like: unsigned char s[] = { 0x31, 0xed, 0x49, 0x89, ..., 0x01}; unsigned char h[20]; RIPEMD160(s,...
19 Mar 2020 by CPallini
What about The Documentation[^]? Looks you are unfamiliar with the documentese (you should fix that as soon as possible). try const char mystr = "My Beautiful String"; // first parameter is the input string unsigned long len = strlen(...
19 Mar 2020 by Asish6542165
I want to code a c program to perform ripemd160 hash on a char array. But I cannot figure out how could I do it. Can anyone suggest a c code to do the following? What I have tried: I came across this function in OpenSSL but I cannot figureout...
19 Mar 2020 by OriginalGriff
Have you considered reading the documentation: /docs/man1.0.2/man3/RIPEMD160.html[^] at all?
19 Mar 2020 by OriginalGriff
Repost: Deleted. Please do not post the same question multiple times: it duplicates work and that annoys people. Annoying people is not the best way to get them to help you ...
19 Mar 2020 by OriginalGriff
You seem to be a little confused: Quote: If you replace the public key with any string which is small enough it will work correctly. SHA is a hashing algorithm, not an encryption algorithm - it doesn't use a key, public or private. Hashing...
19 Mar 2020 by Asish6542165
I want some help with the implementation of sha256 and ripemd160 hash in the c program. Does anyone know how can I perform sha256 on a char array? I wrote a code #include #include #include int main...
22 Feb 2020 by Morbiddeath
Hi, I have copied this piece of code from another site and have trouble compiling it; I'm new to cryptography and whilst I tried my best to get this to work, i keep getting "Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)" I know this error has to do with the heap but I didn't perform any...
31 Dec 2019 by ali_heidari_
hi...i am using rijndeal to encrypt and decrypt some data! but it gives me this error :Padding is invalid and cannot be removed.i searched much but nothing help me to solve this error! tis is my encrypt/decrypt codes:public string Encrypt(string text) { mainRM = new...
31 Dec 2019 by Member 14703898
Line 52: byte[] plainText = rijndaelCipher.CreateDecryptor().TransformFinalBlock(encryptedData, 0, encryptedData.Length);
14 Nov 2019 by CPallini
An assembly implementation of the AES-128 cipher algorithm for the 8051 microcontroller
30 Oct 2019 by Dave Kreskowiak
HMAC is a cryptographic hash, not an encryption. You cannot get the original content back from the hash value.
30 Oct 2019 by saide_a
hi all I have faced a problem in using HMAC of cryptopp library in decoding section. I have used the flowing code for encoding the planText and it works okay this code is described in this link [HMAC - Crypto++ Wiki[^]] AutoSeededRandomPool prng; SecByteBlock key(16); ...
30 Oct 2019 by Richard Deeming
HMAC is a one-way cryptographic hash function. You cannot retrieve the plaintext from the hash. HMAC - Wikipedia[^]
17 Oct 2019 by Manoj Chamikara
Hi All I have to do update APS.Net MVC System someones did long time ago. there is a problem to run page while debugging web.config file section called appSecureSection. that developer leave the company long time ago and cannot to contact him Is there is any way to do this ? Thanks In...
6 Sep 2019 by Member 12766259
What are the steps to make a system like this: 1. User installs the software 2. Software generates a 'fingerprint' key derived from unique hardware ID's 3. Sends this key to the license server 4. Server checks this key if it is present validates it, if not, adds it in to database. 5. After each...
6 Sep 2019 by MadMyche
In all reality the process is not much different than validation of a user name and password; and from what you have provided your logic seems flawed, and I would suggest you rethink this process. Your software generates a fingerprint which is a completely valid thought; and could be a great...
5 Sep 2019 by Patrice T
Quote: 5. After each launch license is validated online. This means that: - if license server is down, not legitimate user can use your program. - if user is offline or have a problem with internet, he can't use your program. Isn't it a little bit extreme ?
5 Sep 2019 by RickZeeland
See CodeProject articles: A Ready To Use Software Licensing Solution in C#[^] Licensing systems in .NET[^] And also: Open Source .NET License Tool, EasyLicense ![^]
22 Jul 2019 by Michael Chourdakis
A standard-compliant library for secure signing
23 May 2019 by Saira Fazal Qader
Conversion of image to byte and Encryption using 128 bit key than Decryption using the same key and re-conversion from byte to image
17 May 2019 by TheOneTrueMongoloid
I have the libsodium-net NuGet loaded into my PoC solution and have the 32-bit and 64-bit libsodium.dll files in their respective directories (System32 and SysWOW64). Whenever I go to run the program in debug mode, I get the BadImageFormatException error. Is it enough to have the libsodium.dll...
17 May 2019 by Dave Kreskowiak
The 2017 runtime is just an update to the 2015 version. If you install 2017, you have 2015. The version number for 2015 is 14.0 whereas for 2017 it's 14.4. If you've got 2017 installed, you already have 2015 along with it. As for you main issue. Not a clue. Every time I've seen that is...
20 Mar 2019 by Ger Hayden
The RSACryptoServiceProvider is not implemented in .NET Core yet so while I have managed to generate keys I cannot get Encrypt or Decrpyt to work so I need my own alternatives. I cant find anything useful on line to guide me. The logic I want to implement is 1. Client calls API for RSA public...
20 Mar 2019 by MadMyche
Which part of RSA is missing? MS Docs NetCore 2.1 | RSACryptoServiceProvider Class[^]
13 Mar 2019 by Member 13329678
Hello all, I have a .net 1.1 web app and i need to encrypt data with HMACSHA256 with key, which is not supported. I cannot upgrade the project, since it is our clients live website. It is really important to use this algorithm for online payments - no other algorithm is supported by the bank. ...
12 Mar 2019 by OriginalGriff
Several things: 1) It may be urgent to you, but it isn't to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response. 2) Never, ever, accept code from a insecure website to handle...
7 Feb 2019 by Sibeesh Passion
Create own cryptocurrency and own private consortium network in Azure
27 Jan 2019 by Member 14130699
This is my code in program.cs: static void Main(string[] arg) { Boolean bCreatedNew; Mutex m = new Mutex(false, "schoolProject", out bCreatedNew); m.WaitOne(); GC.Collect(); if (!bCreatedNew) return; ...
27 Jan 2019 by Richard MacCutchan
Yes, you have got the AES key. It is just that many of the bytes are not printable alphanumeric characters. You need to understand that a byte can have any value between 0 and 255, and only some of those values equate to printable characters. Google will find you the full set. Given that this...
10 Dec 2018 by OriginalGriff
Quote: i have done encrypted mention code in c-Arduino and want to decrypted it into c# but when we try to decrypt it in c# receiving different error We can't help you directly - there are too many variables, and we can't run both sides of your code under the same circumstances. So the first...
10 Dec 2018 by alisolution
Greeting, I want to codes which create Encryption in Arduino-C and can be Decrypted into c#. is it possible ? Using algorithm AES or any other an algorthim anyone help me, can provide codes AJ What I have tried: #include "AES.h" #include "base64.h" AES aes; void setup() { ...
18 Oct 2018 by kanangandhi
Read this article[^]
18 Oct 2018 by Member 14022201
Hello All, I want to Decrypt a string using private key that has been provided. I have started coding recently in C# any help with a code will be highly appreciated. What I have tried: I am completely new to this so I don't even know where to start from I have read about the private and...
18 Oct 2018 by Alek Massey
You could change your program to also allow inputs of an encrypted string and of the private key and then use the key to decrypt the string.