Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [cryptography]

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

26 questions
Filter by
Sorted by
Tagged with
104 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 ...
38 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 ...
123 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 ...
65 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 ...
34 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: ...
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[]"...
99 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: ...
188 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}$ ?
58 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 ...
407 views

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

If you run this code on 11.2 ...
132 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 ...
172 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 ...
50 views

Can't use keys of less that 64 bits long

Probably a bug: key = GenerateSymmetricKey[ Method -> <|"Cipher" -> "Blowfish", "KeySize" -> 16|>] Encrypt[key, "test"] ...
76 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 <...
67 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 ...
76 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 ...
669 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 ...
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?...
477 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: ...
332 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. ...
364 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 ...
432 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].
173 views

...