RSA SSA PSS & PKCS7 test vectors with SHA 256 - rsa

Can someone share the test vectors for RSA SSA PSS & V1.5 PKCS7 with SHA 256 algorithm along with salt length?

Related

Number of bits required after thresholding - DCT

For a question on an assignment I am required to implement image compression via thresholding in Discrete Cosine Transformation. I've converted my required greyscale image to a matrix of DCT co-efficients, and have thresholded values by setting co-efficients below a certain proportion of the maximum absolute co-efficient to 0.
Now I am also required to calculate the total number of bits after compression. Assuming that all co-efficients that have value 0 require 0 bits to represent, i.e, no overhead of RLE or whatever else, by my understanding the total number of bits should be (number of non-zero co-efficients) x (size of variable), which is double in this case (in Matlab).
The issue is, if I set my threshold to be 1% of the max. value, I end up with 36,714 non-zero values in the thresholded matrix. Since doubles in Matlab are 64 bits, the number of bits required is 64*36714 = 2349696 bits. Compare this with the original 512x512 greyscale image, which required 512*512*8 bits = 2097152 bits. Thus my "compressed" image is actually larger than the original one!
Given that I can only use thresholding, and no quantisation of any sort, is this really the number of bits required with a threshold of 1%? Or is there a way to store doubles in Matlab without having to use 64 bits?

How do you count the number of bits in an image after compression through DCT? [duplicate]

This question already has answers here:
How to know the size of a variable in MATLAB
(6 answers)
Closed 8 years ago.
I need to know how to enumerate the number of bits in an image (in MATLAB) after applying the DCT algorithm (compressing the image) to an image, I need to see the number of bits of an image after applying the DCT algorithm. Because I am applying it to a 512 x 512 image but I am getting the same number of bit before and after compression was wondering is there any Matlab code which calculates the number of bits for an image.
DCT is transform, not compression. No information is lost after applying it to input signal.
Normaly, algorithms like jpg, after DCT transform applies quantization of DCT coefficients to reduce amount of data. After then quantized coefficients arÄ™ compressed using huffman or other lossless compression algorithm.
So DCT is not able to say how many bits you are going to have after. You should ask huffman.
The DCT algorithm itself does not reduce the size of the image matrix.
It applies a transform to the spatial domain matrix input, and outputs a
matrix in the frequency domain. See this for a more detailed explanation.
http://www.mathworks.com/help/images/discrete-cosine-transform.html#f21-16149
Depending on the number of DCT coefficients discarded, which dictates the amount
of compression you are applying, the remaining non-zero coefficients tells you how
many bits remains. The number of bits per coefficient is determined by the class of
the image X.
e.g.
class(X)
ans =
double
double is 64 bit
single is 32 bit

Does a linear cryptographic hash function exist?

Does a linear cryptographic hash function exist?
By linear I mean a function 'f' such that:
where + is mod n for some large constant n
Yes,the cryptographically strong SWIFFT algorithm (a variant was a condender for the SHA3 standard) is linear such that h(a + b) = h(a) + h(b)
It is an interesting example of a hash that is both cryptographically strong and not psuedorandom. It is also another unexpected use of the much lauded FFT algorithm.
http://en.wikipedia.org/wiki/SWIFFT

Bitwise XOR between uint8 and logical in Matlab

I have a 8x1 uint8 vector that I want to bitwise XOR with a 8x8 logical matrix, so I need to xor 64 bits with 64 bits in different formats. The result must be a 8x8 logical matrix.
The reason for this is that I am working with a .bmp image and a binary image.
How do I do this in Matlab R2012a?
xor(de2bi(double(A)),B)
If you don't have de2bi.m (Communications Toolbox), take the de2bi.m from an octave installation (open source) and replace "endfunction" with "end" and "endif" with "end" or use this definition: de2bi=#(x)dec2bin(x)=='1'.

Hash functions multiplying key with constant

How does a constant before the key in the formula:
h(k) = (const * key) % m,
affect the distribution of the hash values in the table?
Are there any rules on how to choose such a constant to minimize collisions and get an even distribution of the keys in the hash table?
The constant factor should be prime, and if I remember correctly it should be relatively prime w.r.t. the modulus. This is all discussed at great length in Knuth Volume III.