# Questions tagged [cryptography]

Questions regarding Mathematica cryptography related functionality (introduced in Mathematica 10).

29 questions
Filter by
Sorted by
Tagged with
52 views

### How do I use mathematica for encryption if someone gave me their Public Key in PGP format?

How do I do Mathematica to a encrypt a message when someone has given me their public PGP key? Does Mathematica have this functionality? Could I use Mathematica ...
253 views

### Couldn't load OpenSSL library in 12.1 (Windows)

Update: Finally I found a clumsy way to solve this bug by myself: I created an alternate local kernel to run the code, and it surprisingly works out! It is ridiculous that two local kernels contain ...
48 views

### how to scramble and then unscramble a list of elements?

list = {"a", "b", "c", "d"}; scrambledList=scramble[list] {"b", "d", "a", "c"} unscramble[scrambledList] {"a", "b", "c"...
128 views

### Number theory in Mathematica

Is there any book out there similar to S. Wagon's Mathematica in Action that has problems/exercises/projects in the field of number theory as done in Mathematica? If not pure number theory, at least ...
43 views

### User Implemented SHA-1 is failing for strings of length >512 bits

So, earlier, I posed a question regarding getting a user implemented SHA-1 hash function to work correctly. Well, I fixed the problems, cleaned it up a little bit, but now I have the problem for when ...
137 views

### User implemented SHA-1 isn't outputting correct hash

EDIT: I'm actually Thinking the issue is in the initialization phase, where we pad the message with 1's, 0's, and the message ...
66 views

### Applying Polybius cypher [closed]

I need to define a function that can apply the Polybius cypher encoding technique. I did some very basic case with if statement, however, if the input is random with A and B I have no idea how to ...
37 views

### Keyed Hash for HMAC SHA256 [duplicate]

I'm trying to use AWS REST API's (because I can't rely on AWSLink`). The sample C# code from Amazon uses this a lot: ...
74 views

### What is the best build-in function to pick or select given element in a huge list

im looking for a best and efficient function works like a search engine it takes for example m=5+6I ,then it goes searching in the list V={1,1+I,2+3I,...} until catch it . My Dr said to use "Select[]"...
118 views

### Can Decrypt[] be forced to decrypt with a different key?

Decrypt[] will yield an error if one tries to decrypt a byte array using a different symmetric key than the one used to encrypt: ...
234 views

### How to construct addition and multiplication table for finite field?

For example, choose $p(X) = X^4 + X + 1$, how to construct addition and multiplication tables for $\mathbb{F}_{2}[X] \mod{X^4 + X + 1}$ ?
64 views

### Is this decryption function idiomatic?

This is my first non-trivial Mathematica notebook, which I wrote for a cryptology homework. It encrypts/decrypts strings using an affine cipher. Is the code readable/idiomatic? How could it be ...
448 views

### HMAC correct on 11.2 but wrong and different on 11.3 running same code

If you run this code on 11.2 ...
138 views

I am trying to recreate a Java algorithm in Mathematica. It is taking a key and signing a message using the HMAC and SHA256 algorithm. The Java code for which I am basing it off is here I have ...
201 views

### Is it possible to convert the output of the Encrypt[] function into binary digits?

I use the following code to generate a key and then use it to encrypt a simple string message. The output of the function Encrypt is an encrypted object. But I would rather convert this into binary ...
51 views

### Can't use keys of less that 64 bits long

Probably a bug: key = GenerateSymmetricKey[ Method -> <|"Cipher" -> "Blowfish", "KeySize" -> 16|>] Encrypt[key, "test"] ...
83 views

### Why can't Encrypt handle messages bigger than very small?

This keys = GenerateAsymmetricKeyPair[]; message = Rasterize[Graphics[Disk[]], RasterSize -> 10]; Encrypt[keys["PrivateKey"], message] generates the error <...
73 views

### Can I make a SymmetricKey with my own key value?

Mathematica has a function that one can use like this GenerateSymmetricKey[Method -> <|"Cipher" -> "AES128", "BlockMode" -> "CBC"|>] but it picks ...
91 views

### Decoding Message-Signature Pairs

I've been given a set of message-signature pairs to decrypt using a public RSA key I set up. I need to sort through the decoded messages, and find which of those have a valid signature. My public key ...
715 views

### Code Review: ECDSA for Mathematica

The code below contains functions related to ECDSA (Elliptic Curve Digital Signature Algorithm) with standard parameters secp256k1. The implementation is based on ...
1k views

### Extract every nth character from a string

I'm trying to extract every 21st character from this text, s (given below), to create new strings of all 1st characters, 2nd characters, etc. I have already separated the long string into substrings ...
70 views

### Hamming decoding

I have a small notebook that copies the example of the McEliece cryptosystem found here. The page omits the step used to decode $y'$. Does Mathematica contain any facilities for using Hamming decoding?...
566 views

### Implementing an affine cipher

I am trying to create functions for encoding and decoding an affine cipher in Mathematica. I have written these two functions: ...
354 views

### Solving a substitution cipher [closed]

I am looking for a way to use Mathematica to decipher cipher texts that have been encrypted with a simple substitution cipher. Last week, our teacher worked the board on the following cipher. ...
386 views

### How can I encrypt/decrypt a directory?

I'd like to use Mathematica 10's new Encrypt and Decrypt functions to secure files and folders on my mac. Here's what I have so far but something goes wrong along the way, since by the end of this ...
464 views

### Pollard's Rho algorithm

I'm working in Mathematica and I'm trying to implement the [Pollard's Rho Algorithm for the Discrete Logartihm Problem].
241 views

...