encryption

Obfuscate/Encrypt SharedPreferences file possible?

白昼怎懂夜的黑 提交于 2020-01-14 13:51:09
问题 So, I'm interested in obfuscating the SharedPreferences xml file of my app, much like Android LVL does to obfuscate it's license cahce data. Would this be conceivable? Plenty of google-digging has yielded little results that might address my question. And I'm certainly no cryptologist. What about other forms of encryption? My end goal isn't to try making the xml bulletproof, I just want to block out the lower 90% of people who would refrain from messing around with it if it's not in plain

How to deal with massive numbers in C

若如初见. 提交于 2020-01-14 09:42:59
问题 I am writing an RSA encryption algorithm in C. Im not planning to put it in production anywhere, it is mainly just so I can broaden my understanding of encryption. How do I deal with the massive numbers that RSA generates? Even when performing decryption with a relatively small private key like 103, I still have the issue of dealing with things like this: 67^103 mod 143 = (1.21816096336830017301951805581 x 10^188) mod 143 What is the best way to store a number of that size? Is there any way

How to deal with massive numbers in C

假如想象 提交于 2020-01-14 09:42:09
问题 I am writing an RSA encryption algorithm in C. Im not planning to put it in production anywhere, it is mainly just so I can broaden my understanding of encryption. How do I deal with the massive numbers that RSA generates? Even when performing decryption with a relatively small private key like 103, I still have the issue of dealing with things like this: 67^103 mod 143 = (1.21816096336830017301951805581 x 10^188) mod 143 What is the best way to store a number of that size? Is there any way

Unable to decrypt csv file using symmetric key java

ε祈祈猫儿з 提交于 2020-01-14 06:54:09
问题 I am provided two files encrypted_key.enc and encrypted_data.csv.enc . I need to use my private key to decrypt the encrypted_key.enc to get a symmetric key and then use that symmetric key to decrypt the encrypted_data.csv.enc file. On the terminal, the following commands get the job done: openssl rsautl -decrypt -ssl -inkey my_private_key -in encrypted_key.enc -out key openssl aes-256-cbc -d -in encrypted_data.csv.enc -out secret.txt -pass file:key My goal is to perform the java equivalent of

iText signing PDF using external signature with PKI SIM

蹲街弑〆低调 提交于 2020-01-14 06:18:04
问题 I am trying to use mobile signature service provider (MSSP) to sign the pdf file. I used some code below to do. But the signature is invalid with the message "The document has been altered or corrupted since the signatures was applied." Encode in "APWebService.sign(phoneNumber, messageDisplay, encode)" only accept 44 charracter. Anyone can help me? public class MyExternalSignatureContainer implements ExternalSignatureContainer { protected byte[] sig; protected Certificate[] chain; public

AES encryption with plain text key using bash openssl

你说的曾经没有我的故事 提交于 2020-01-14 06:00:23
问题 I am trying to encrypt a string using AES CBC. The output of the online tool (http://aes.online-domain-tools.com/) and the bash openssl command do not match. Can anyone help me with what I am doing wrong? key = 12345678912345678912345678912345 iv="e90e89a2277f4f3b6a2080d27f734266" #using the one generated by online tool openssl enc -aes-256-cbc -in input.txt -out output.txt -K $key -iv $iv EDIT - more info on the settings chosen on the site - Input type - plain text Function - AES Mode - CBC

AES_ctr128_encrypt string and vice versa ANSI C

落花浮王杯 提交于 2020-01-14 05:44:26
问题 I need to insert a 128 hex key to cipher by blocks (16) a string content, and then I want to decrypyt that string(crypted) to a plain text. Sometimes I have the same output, but not totaly correct! I am doing this right?! My code now: #include <openssl/aes.h> #include <openssl/rand.h> #include <openssl/hmac.h> #include <openssl/buffer.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> // Code example uses partail code from: http://stackoverflow.com/questions

Unable to replicate an encryption format from Java to PHP

丶灬走出姿态 提交于 2020-01-14 04:44:27
问题 I have the following Java code which was shared by one of an integration partner for their API encryption import java.nio.ByteBuffer; import java.security.AlgorithmParameters; import java.security.SecureRandom; import java.security.spec.KeySpec; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec

What is a simple but somewhat effective way to “obfuscate” numeric values?

梦想的初衷 提交于 2020-01-14 04:41:06
问题 Let's say I have an Access database table that has 2 columns: one is ID (from 1 to 20000, sequentially and each is unique) and one is Value (any number from 0 to 500). How do I obfuscate the Value field (using ID or not using ID) in a simple but somewhat effective way? I expect something slightly more effective than ROT13 obfuscation but not so complicated that decoing needs more than one line of code. The decoding is done in C# code. The obfuscation is done via calculated field in Access. I

Storing the IV with the ciphertext Crypto++ CBC AES encryption

匆匆过客 提交于 2020-01-14 04:38:05
问题 I'm trying to encrypt(and decrypt after) a file using AES in CBC mode and Crypto++ library Here's what I already did: using namespace CryptoPP; AutoSeededRandomPool rnd; //generating the key and iv SecByteBlock key(AES::MAX_KEYLENGTH); rnd.GenerateBlock(key, key.size()); byte iv[AES::BLOCKSIZE]; rnd.GenerateBlock(iv, AES::BLOCKSIZE); To encrypt a file,I open it in binary mode,and dump the content to a string : std::ifstream fin(file_path, std::ios::binary); if (!fin) { std::cout << "error"; }