encryption

UWP: AES encryption and decryption

天涯浪子 提交于 2020-01-10 05:29:21
问题 I had a simple class to do some basic local encryption for Windows Phone 8. I wanted to use the class again in a new UWP Windows 10 app for the Windows Store. Unfortunately I cannot use the AesManaged class anymore. I tried to use Windows.Security.Cryptography.Core , but I'm completely stuck. This is the original class I used for Windows Phone 8. I must have found it somewhere on the internet back then. using System.Security.Cryptography; namespace TestGame { public class AesEnDecryption {

What's the easiest way to encrypt a file in c#?

狂风中的少年 提交于 2020-01-10 04:19:10
问题 Beforehand : I have read indeed the other topics on SO, but I can't find an answer in them. (The others are about config-files, or a list of techniques) My question thus is very simple, though a bit subjective (I'll label it beforehand :-)) what is the easiest way.. 回答1: File.Encrypt is pretty simple - one call (with one parameter). Of course, it really depends on what you want the encryption for. File.Encrypt encrypts to the current account, which isn't much use if you're passing the file

Is it possible to use AES128 with GCM mode on iOS?

会有一股神秘感。 提交于 2020-01-10 04:12:28
问题 So my question for you stackoverflow geniuses is: if there a way (native, library, framework, whatever..) to encrypt data with AES (preferably 128 but could be 256 too) using a strong Authenticated encryption algorithm , let's say GCM mode ? Question is short, I have done some research and I only found one library that seems to support it ( RNCryptor ) but it also seems to use password to crypt instead of keys (like you provide a password and the library made the key) and I don't like that a

Problem transmiting a RSA public key, javaME , bouncy castle

余生颓废 提交于 2020-01-10 03:12:07
问题 I'm working on the porting of an instance messaging application from Java to JavaME ,that also implements cryptography. The problem is that I want to send my public key to the server. The desktop client has this code for this job: byte[] encoded_public_key=publick_key.getEncoded(); And the server has this code to retrieve the key: EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encoded_public_key); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); PublicKey puKey = keyFactory

Problem transmiting a RSA public key, javaME , bouncy castle

你说的曾经没有我的故事 提交于 2020-01-10 03:12:05
问题 I'm working on the porting of an instance messaging application from Java to JavaME ,that also implements cryptography. The problem is that I want to send my public key to the server. The desktop client has this code for this job: byte[] encoded_public_key=publick_key.getEncoded(); And the server has this code to retrieve the key: EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encoded_public_key); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); PublicKey puKey = keyFactory

How does password-based encryption technically work?

一笑奈何 提交于 2020-01-09 19:47:08
问题 Say I have some data and a password, and I want to encrypt the data in such a way that it can only be recovered with the right password. How does this technically work (i.e. how to implement this)? I often hear people use bitshifting for encryption, but how do you base that on a password? How does password-based encryption work? An example is Mac OS X FileVault Thanks. If you give sample code, preferably in C, Objective-C or pseudocode. 回答1: For (symmetric) encryption you need a secret key

AES/CBC/PKCS5PADDING IV - Decryption in NodeJs (Encrypted in Java)

吃可爱长大的小学妹 提交于 2020-01-09 18:22:50
问题 I am trying to decrypt in NodeJs. It is working in Java. But I am not able to achieve same in Node. node-version: 8.4 Please find my NodeJs code: var crypto = require('crypto'); function decryption (message, key) { var messageArray = Buffer.from(message, 'base64'); // var kekbuf = Buffer(key, 'utf8'); var ivBuffer = new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]); var iv = ivBuffer.slice(0, 16); var decipher = crypto.createDecipheriv('aes-256-cbc', key, iv); decipher.setAutoPadding(false); var

How do I prevent replay attacks?

◇◆丶佛笑我妖孽 提交于 2020-01-09 13:05:30
问题 This is related to another question I asked. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I somehow need to know who they are, and I need to know they're logged in! I think I came up with a solution to my problem, but it needs fleshing out. Here's what I'm thinking. I create a hidden form field called "username", and place within it the user's username, encrypted. Then, when the

How do I prevent replay attacks?

放肆的年华 提交于 2020-01-09 13:05:10
问题 This is related to another question I asked. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I somehow need to know who they are, and I need to know they're logged in! I think I came up with a solution to my problem, but it needs fleshing out. Here's what I'm thinking. I create a hidden form field called "username", and place within it the user's username, encrypted. Then, when the

AES encryption, what are public and private keys?

一世执手 提交于 2020-01-09 12:20:40
问题 In AES encryption (.net framework), how are the public and private keys used? Are the public and private keys combined to form a full key, and then the algorithm uses the public + private key to encrypt the data? (simplified keys used below for example purposes) e.g. public key = 12345 private key = 67890 so the key used when generating the encryption result is: 1234567890 回答1: As others have said, AES is a symmetric algorithm (private-key cryptography). This involves a single key which is a