Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cryptography]

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

3
votes
1answer
87 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 ...
2
votes
1answer
37 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 ...
3
votes
1answer
115 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 ...
2
votes
1answer
63 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 ...
1
vote
0answers
33 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: ...
0
votes
1answer
70 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[]"...
2
votes
1answer
75 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: ...
1
vote
1answer
170 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} $ ?
1
vote
1answer
56 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 ...
17
votes
1answer
400 views
4
votes
2answers
129 views

J/Link HMAC Base64

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 ...
6
votes
1answer
161 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 ...
4
votes
1answer
48 views

Can't use keys of less that 64 bits long

Probably a bug: key = GenerateSymmetricKey[ Method -> <|"Cipher" -> "Blowfish", "KeySize" -> 16|>] Encrypt[key, "test"] ...
4
votes
1answer
74 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 <...
3
votes
1answer
64 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 ...
1
vote
1answer
69 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 ...
3
votes
0answers
592 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 ...
3
votes
3answers
951 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 ...
1
vote
0answers
67 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?...
2
votes
2answers
438 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: ...
3
votes
0answers
322 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. ...
6
votes
2answers
345 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 ...
4
votes
2answers
412 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][1].
2
votes
0answers
161 views
22
votes
3answers
494 views

Can't inject EncryptedObject

Bug present from 10.0 to 10.3.1 and fixed in 10.4.0 !! Here are minimal examples: ...
5
votes
0answers
962 views

Elliptic curve cryptography in Mathematica

I can find no resources for doing elliptic curve cryptography. I have used the finite field package, but I find it cumbersome and it does not seem to have any builtin methods for ECC. How can I get ...