Questions tagged [cryptography]

Cryptography plays a vital role in the realm of programming. It encompasses various aspects such as symmetric and asymmetric encryption, hashing techniques, and digital signatures. If you have any queries regarding cryptography that are not directly linked to software development, it is advisable to seek assistance from cryptography.

Node's getRandomValues() function is throwing an "expected Uint8Array" error

Currently, I am experimenting with the getRandomValues() function to enhance an encryption REST API that I am developing for practice. My server is using Node, which means I do not have access to a window object containing the crypto object normally housin ...

Forge: Securely encrypting massive files

I rely on the forge framework for implementing PGP functionality, specifically for encrypting large files (2gb or larger) while minimizing RAM usage. What would be the most efficient approach to achieve this? ...

What steps should I follow to create the decrypt function for the encrypt function I've implemented?

Recently, I've come across an encrypt function that I am struggling with: def encrypt(password): for i in (password): not_Encrpyted = ''.join(dict_Chiper[i] for i in password) Encrpyted = ''.join(reversed(not_Encrpyted)) return Enc ...

Obtain identical encryption results with CryptoJS (JavaScript) and OpenSSL (PHP)

I am in the process of integrating a PHP encryption function into a ReactJS application. I have a requirement to transmit the token in a specific format that was generated using the OpenSSL library function (openssl_encrypt). It has been observed that the ...

Filtering elements in Python API results

Using the CoinGecko APIs (), I encountered an issue with selecting a specific call element. The code snippet in question is as follows: from pycoingecko import CoinGeckoAPI cg = CoinGeckoAPI() mhccex = cg.get_coin_ticker_by_id(id='metahash', exchange_ids= ...

Guide on decrypting a file encrypted with C# using Node JS

I currently have encrypted files in C# using DES and PKCS7 encryption. My objective is to decrypt these files in Node JS. The decryption code in C# that I am using appears like this: public string SSFile_Reader( string fileToDecrypt ) { DESCryptoService ...

What is the process for storing public and private keys in a file with node.js crypto?

I am working with the crypto module in node.js and have successfully generated a public/private key pair. However, I am facing an issue when trying to save it to a file and then load it back into memory from that file. Here is what I have so far: https:// ...

A comprehensive guide to implementing encryption in Node.js

In my attempt to perform encryption using Node.js 7.5.0 and the 'des-cbc' algorithm, I encountered a requirement from RFC 1423. According to this RFC, a 64-bit cryptographic key and a 64-bit initialization vector are needed for this algorithm. My initial ...

Protection from hacking: Minimize server workload and deter OCR technology

Recently, my post received negative feedback due to being too vague. To address this concern, I have included detailed information regarding my research below. Please read through to discover the specific issue. Currently, I am developing a real-time mult ...

What is the process for decrypting a previously encrypted file?

from cryptography.fernet import Fernet key = Fernet.generate_key() cipher = Fernet(key) def encrypt_data(data): encrypted_data = cipher.encrypt(data) return encrypted_data def decrypt_data(encrypted_data): decrypted_data = cipher.decrypt(e ...

Is PBKDF2 HMAC-SHA1 sufficient for securing Crypto-Express.js transactions?

While using the Express.js framework and crypto to hash a password with pbkdf2, I have come across information stating that the default algorithm is HMAC-SHA1. However, I am puzzled as to why it has not been updated to another family or SHA version. crypt ...

Guide to authenticating Cashfree gateway's webhook signature using JavaScript

I have integrated the Cashfree payments gateway successfully. However, I am unsure how to verify the signature of webhooks. https://i.stack.imgur.com/TxdTx.png This is their recommended approach. Could someone guide me on writing JavaScript code for this ...

Attempting to utilize the LLL algorithm as described on Wikipedia has led to encountering significant challenges

I'm struggling with determining whether my issue stems from programming or understanding the LLL algorithm mentioned on Wikipedia. To gain a better understanding of the LLL algorithm, I attempted to implement it following the instructions outlined on ...

Apologies, but there seems to be an issue with decrypting the digital envelope

I have encountered an issue with decrypting encrypted data stored in a database. The encryption process is working correctly, but when attempting to decrypt the data in order to display it on the front-end, I receive the following error: error:06065064:dig ...

PHP (specifically openssl) is effective for decrypting data, whereas javascript (cryptojs) has proven to be ineffective

Decryption is functioning using php/openssl, and I can successfully retrieve my plain data. Here is the specific call that is defined: <?php function decryptString($data, $key) { return base64_decode(openssl_decrypt(base64_decode($data), "AES- ...

The output of the Node.js crypto.pbkdf2 function may not match the result obtained from CryptoJS.PBKDF

Currently, I am utilizing PBKDF2 on both the frontend with CryptoJS and the backend with Node.js. Despite using the identical salt, algorithm, number of iterations, and password, the derived keys are turning out to be different. Below is the code snippet ...

Transforming Python AES into Node JS

I've encountered a challenge trying to make existing legacy Python code encrypt/decrypt data the same way as NodeJS. Although the first 16 characters are correctly decoded, I'm facing issues with the rest of the process. Here's the Python code snippet: f ...

Exploring Laravel 4.2 queries on a database with encrypted column functionalities

In my current controller code, I am displaying a set of records. Here is the snippet: public function view() { $title = "View Guardian Information"; $vPa = DB::table('dbo_guardianinformation') ->join('dbo_cities ...

Discovering a BTC address using a public key with node js

My apologies for any language barriers! Is there a way to decode the hexadecimal public key from a BTC signature script into a string address using node js? For instance, if I have this hex public key: 03745AAAF364030720B2D14DE50A3310EEF521C91E36353DCA2 ...

"Encountering an Issue with Storing Private Key as a String in NodeJS: Saving to .txt Results in Writing "[

Currently, I am attempting to save an EC key pair from the elliptic library as a string in a .txt file. However, when I do this, it ends up writing ""[object Object]"" to the file. UPDATE: Just wanted to note that the issue of turning the object ...