Questions tagged [encryption]

1

votes
1

answer
191

Views

Asymmetric cryptography with reversed key roles

I'm trying to implement licensing system for a software to prevent piracy. For this I need to read a license file within the application, and I need to make sure this file is written by the owner company. Asymmetric cryptography has good potential for this aim, but in other way around! Asymmetric cr...
Mehran
1

votes
3

answer
3.4k

Views

Is my Bcrypt encryption safe enough?

I am working on a project which needs a very advanced security system when it comes to saving passwords etc. So my question is, is this way to save passwords safe enough? This is the way I programmed: When a user registers, a salt will be created out of the following details: An unique user ID (prim...
Jan Willem
1

votes
3

answer
2k

Views

BCrypt check if already crypted?

My question is how can I check if a password is already crypted with Bcrypt.And if it is, let Bcrypt do nothing ,just leave the password like it is.I'm working with Java(EE),Spring. public static String hashPassword(String userPassword) { String bCrypt = null; if (userPassword == null) throw new Nul...
Sunay Hashimov
1

votes
1

answer
658

Views

Port forwarding with encryption

I am searching about 2 months for a port forwarder with encryption and this is making me almost crazy. I tell my goal and maybe someone can help me: I want to forward socks5 packets to another server and make it secure (safe from sniffing) because my ISP parses the socks packets and also blocks some...
Soroush Khosravi
1

votes
2

answer
3.3k

Views

no such algorithm: AES for provider BC

I keep on getting java.security.NoSuchAlgorithmException: no such algorithm: AES for provider BC with my code below. It looks like I have included all the things I need. My class is as follows: .... import org.bouncycastle.jce.provider.BouncyCastleProvider; class ... { static { Security.addProvider(...
gianebao
1

votes
3

answer
3.7k

Views

Asymmetric cryptography - Plaintext size error

I’m trying to encrypt small data using asymmetric cryptography with python. I'm currently using M2Crypto to generate 1024 bit private/public key pair. After using different python libraries, such has M2Crypto and Pycrypto (with several variations on it), I'm having plaintext size problems: ValueEr...
Psycho_Mind
1

votes
2

answer
662

Views

pbkdf2_sha256 C# implementation

I've got a database where passwords are stored as pbkdf2_sha256. I want to create a tool (in C#) which should create new passwords. My problem is: How can I encrypt the password in C#? I found a Java-Class which works for me, but I can not use this sample in C#. Is there a smilar way? I tried also...
Lee
1

votes
1

answer
1.6k

Views

NoSuchAlgorithm exception while using cipher.getInstance method

I am doing password decription logic using cipher java. In that, while getting the instance of cipher using cipher.getInstance("RSA/NONE/NoPadding"). I am getting following exception: NoSuchAlgorithm. The same code is working in my local jboss server setup but not working in IBM-WAS server setup. Is...
Muralidharan
1

votes
1

answer
1.4k

Views

AES CTR symmetric encryption and decryption

I am not an expert in openssl. I have put together the following code to encrypt and decrypt a message using AES-CTR. The output is not what I expect to see. #include "stdafx.h" #include #include #include #include #include #include #include #include #include //for RAND_bytes function struc...
mjan635
1

votes
3

answer
1.7k

Views

Python read text file as binary?

I was trying to build an encryption program in python 2.7. It would read the binary from a file and then use a key to encrypt it. However, I quickly ran into a problem. Files like image files and executables read as hex values. However, text files do not using open(). Even if i run file=open("myfil...
user2514631
1

votes
1

answer
403

Views

WMI Code Creator for Bitlocker Status - where did i go wrong?

I am working with the WMI Code Creator and the code looks to work properly from the app. HOWEVER, It comes up with errors internal of my code that I cant seem to shake. Am I supposed to have a reference for this to work? if so where can I get it? public class MyWMIQuery { public static void Main()...
Joe Pearson
1

votes
2

answer
1.3k

Views

iOS sqlcipher fmdb “File is encrypted or is not a database”

This tutorial works just fine with the following pieces of code. pod 'FMDB/SQLCipher' ... - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainM...
zeeawan
1

votes
2

answer
3.3k

Views

Store AES key in Android

i want to store AES key in AndroidKeyStore on pre-M device i tried to use key generated with KeyGenerator KeyGenerator keyGen = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES); keyGen.init(256); SecretKey secretKey = keyGen.generateKey(); but i cannot access to that key from KeyStore, late...
Mariusz
1

votes
1

answer
1.6k

Views

Encrypt string with Blowfish in NodeJS

I need to encrypt a string but I almost get the output I desire, I read online that it has something to do with padding and iv_vector at the end to complete for the remaining 8 bytes to be same length as txtToEncrypt. I'm using this library https://github.com/agorlov/javascript-blowfish // function...
Hassan Ila
1

votes
1

answer
1.2k

Views

Postfix Error Recipient address rejected: unverified address: mail transport unavailable when its With Ciphermail

i'm setting up a mail server [postfix] which with use Ciphermail as RelayHost. With the setup i'm able to send mail to external domain but when i'm replying from external domain i'm getting following error. ciphermail [relay host] main.cf alias_database = hash:/etc/aliases alias_maps = hash:/etc/al...
Saurabh Agrawal
1

votes
1

answer
190

Views

Does encrypting preserve Base64 encoding

Is encode (Base64) - encrypt - transmit safe over HTTP. Or is encrypt - encode - transmit the right way to do it? Is there possibility of data corruption because of this Why do we use Base64? Using : Javax cipher AES/CBC/PKCS5Padding for encrypting multipart http request with multiple file attache...
Cybermonk
-2

votes
1

answer
14

Views

how to hide source codde like on lionsgate's website?

I wanted to ask you how it is possible to hide the source code like on Lionsgate's website: https://www.lionsgate.com/ If you head over to: view-source:https://www.lionsgate.com/ Here is the code from view-source: (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event...
Viktor Gavrilovic
2

votes
1

answer
21

Views

Let's Encrypt. Certificate all subdomains automaticly. (*.domain.de)

I want to secure all my subdomains, without creating a subdomain on itself and then create a certificate. I'm using .htaccess to redirect a subdomain to a folder. So a subdomain is not created on itself. It's just a nameholder to replace a folder. My problem is: when I want in Plesk to create a *.do...
Viktor Emeljanov
0

votes
0

answer
10

Views

Envelop encryption large file

We are building a mobile app which requires storing files encrypted on the device and later upload it to a server. Only the server needs to be able to decrypt it and if the device is compromised the files should be not decryptable. I've been exploring using public key encryption for this purpose how...
ubi
1

votes
0

answer
207

Views

Read encrypted php files using ajax

I encrypt all my core files using libsodium, but my problem is how to read the php files in decrypted state like calling the file using ajax like automatic decryption. I'm not sure if its possible. Its something like this. Sorry, I'm still exploring on this library I work on this before but method i...
user123
1

votes
2

answer
896

Views

Realm Encryption with Android

Realm is using AES-256 for encryption and decryption. And, I am trying to use Android KeyStore to generate/store the keys, but as per this page - https://developer.android.com/training/articles/keystore.html#SecurityFeatures, Android supports this only on APIs 23 and above. Can someone please point...
user4122421
1

votes
2

answer
349

Views

Spring CLI v2.1.0.RELEASE - encrypt -> NoSuchMethodError

when i run: spring encrypt totallysecretpassword --key=insanity Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.Delega...
womd
1

votes
1

answer
22

Views

Password saving for API usage (php and mysql)

I am using Instagram API by mgp25. Here, you can gain access to the IG api via "logging in": the API (in php) requires a password and account id to be in plain text format when gaining the access. Here is the setup that I have: I have a site where there are users and the site has IG API integration....
steve Kim
1

votes
2

answer
5.2k

Views

How can I encrypt my message when sending to the server?

I would like to encrypt my message when sending to the server from client, how can I do it? Client using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net....
lewis
1

votes
1

answer
16

Views

Java AES-GCM very slow compared to AES-CTR

Consider the following code: import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.GCMParameterSpec; import javax.crypto.spec.IvParameterSpec; import java.security.SecureRandom; public class AES_Mod_Speed { // AES parameters private sta...
M.S. Dousti
1

votes
1

answer
1.6k

Views

C# encryption (AesManaged) to PHP equivalent

I have some data provided by our third party which is encrypted using a C# algorithm. Please see below: using System.Security.Cryptography; private static int KEY_SIZE = 32; private static byte[] IV = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; public static string EncryptString(string plain...
Faheem Hameed
0

votes
0

answer
14

Views

Caesar Cipher algorithm problem with wrapping after char '~'

I have a homework working with the Caesar Cipher and I have a small problem with wrapping after char '~'. If I encrypt letter (char) 'x' and the key is 48, then the result must be 'I', therefore, when I decrypt char 'I' with key = 48, the result must be char 'x' but unfortunately that isn't the cas...
TWDbag
0

votes
0

answer
14

Views

Encrypting and then decrypting a string in PHP

My encryption function works fine but I cannot reverse it into decryption function. How to do that? Any thoughts? Here is my code //CORRECT ENCRYPTION METHOD function encrypt($data) { $key = "SiadajerSiadajer"; $iv_size = 16; $iv = openssl_random_pseudo_bytes($iv_size, $strong); $encryptedData = op...
Pozeracz Sloikow
3

votes
1

answer
28

Views

What is the most secure mcrpyt_encrypt algorithm?

I am trying to come up with a secure algorithm to encrypt and decrypt specific strings in my project I am working on. I am using the mcrypt_encrypt with the MCRYPT_RIJNDAEL_256 block cipher variation. I have tested many and found this one to seem quite secure. I am making the encrypt and decrypt in...
ApexLegend
1

votes
0

answer
10

Views

Encryption using symmetric openssl aes-128-cbc SHA256 encryption

Problem: Want to achieve symmetric encryption using openssl aes-256-cbc -a -in avengers.txt -out avengers.enc -md md5 so if I pass the encrypted text in below code or in openssl aes-256-cbc -a -d -in avengers.enc -md md5 I get the actual strong. Can anyone help me in factoring the below code to do e...
QubesX
1

votes
1

answer
1.7k

Views

addIdentity in JSch is private key of calling program's Server

"Server 1" is reading from and writing to "Server 2" using SSH. "Server 1" is having "Server 1's" private key and public key of "Server 2". "Server 2" is having "Server 2's" private key and public key of "Server 1". In JSch, when I use a Java program to communicate from "Server 1" to "Server 2", the...
sunleo
1

votes
1

answer
12.7k

Views

SpringSecurity : decode a password encoded with PasswordEncoder

I have stored (and encoded) an email password. I have used PasswordEncoder (Spring security). passwordEncoder.encode(password); Now I need to decode it in order to use it in javax mail. (the password is used to connect to the email provider(yahoo, gmail, etc). Is there a way to decode this password?...
user1260928
1

votes
2

answer
670

Views

Encrypt random 6 digit number -> human readable

We have numbers from 1 to 999999 we need to encrypt with an easy algorithm. The encrypted output should be human readable characters (A-Z, 0-9) and no longer than 6 digits. Is it possible with a simple algorith to encrypt the number 123456 to e.g. GH6ZT3 and later decrypt GH6ZT3 to 123456 ? I only c...
tgoetz
1

votes
2

answer
105

Views

Storing MySQL credentials in a MySQL database

This is a similar question to "Storing MS SQL Server credentials in a MySQL Database" So, in theory, imagine I have 1 MySQL server. I have a "master" database, and then X number of other generic databases. What im looking for, is a way of using an app (for arguments sake, lets say a web app, running...
verenion
1

votes
1

answer
1.6k

Views

(java.security.InvalidKeyException) No IV set when one expected error at cipher.init(Cipher.DECRYPT_MODE, key)

SecretKey key = keyFactory.generateSecret(keySpec); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.DECRYPT_MODE, key); byte[] ciphertext = cipher.doFinal(cleartext); return bytes2String(ciphertext); I am getting java.security.InvalidKeyException i.e. no IV set when on...
Sourav Bebarta
1

votes
1

answer
303

Views

Out of memory error with Cipher.dofinal()

I am developing an Android application for which I am decrypting a large file using Cipher Class of Android. Code: private byte[] decrypt_chunk(byte[] data, ByteString chunk_encryption_key) { SecretKeySpec skeySpec = new SecretKeySpec(chunk_encryption_key.toByteArray(), 1, 16, "AES"); Cipher cipher;...
Nimesh Chandramaniya
1

votes
1

answer
1.1k

Views

Decrypting data encrypted with AES-256-CBC in C# as with PHP

I did some encryption using PHP in my Database and would normally decrypt using: $encrypt_method = "AES-256-CBC"; $secret_key = "testing"; $secret_iv = "testingyes!!!"; $key = hash('sha256', $secret_key); // hash the key $iv = substr(hash('sha256', $secret_iv), 0, 16); // iv - encrypt method AES-256...
D. Rattansingh
1

votes
1

answer
1k

Views

Using AES Encryption for sensitive data in MYSQL - Implementation Questions

There are a number of questions that discuss storing sensitive information in MYSQL using encryption. Some make great suggestions about hardening the web server, database server, and web application (Store 'sensitive' data in MySQL DB). However, little has been discussed about the exact implementati...
OverlordvI
1

votes
1

answer
919

Views

Decrypt AES256 encrypted string with VB.net

I want to decrypt in VB.net strings encrypted in PHP via openssl_encrypt function: $encrypted_string = openssl_encrypt( $string, 'AES256', 'secret_password', 0, 'initialization_vector' ); I tried with this class: Public Class Aes256Encrypter Public Function Encrypt(ByVal plainText As String, ByVal s...
Blazeag
1

votes
1

answer
1.1k

Views

Django, Security and Settings

From here, we add all database info as text: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'mydatabase', 'USER': 'mydatabaseuser', 'PASSWORD': 'mypassword', 'HOST': '127.0.0.1', 'PORT': '5432', } } Is it a secure way? Is there any way to save this data as Encrypted da...
TheNone

View additional questions