I HAVE A KEY WHICH IS 1*16 MATRIX. HOW CAN I DETERMINE IT'S BIT SIZE?
2 次查看(过去 30 天)
显示 更早的评论
采纳的回答
KSSV
2022-8-16
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0] ;
a = single(KEY) ;
iwant = whos('a')
3 个评论
Walter Roberson
2022-8-16
编辑:Walter Roberson
2022-8-16
Will this key prevent brute force attack
NO it will not prevent brute force attack.
There is no known way of preventing brute force attacks.
There are some famous cases where particular encryption challenges were broken by way of contests that organized thousands of computers on the Internet to keep trying sequential possibilities.
You have 4 bits per entry and 16 entries, for a total of 64 bits. It is accepted that the NSA can brute force 64 bit DES encryption keys, using their custom-built hardware.
更多回答(2 个)
Abderrahim. B
2022-8-16
编辑:Abderrahim. B
2022-8-16
Hi!
Try this:
KEY = [0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0] ;
KEY = single(KEY) ;
% WHOS returns a structure
S = whos("KEY") ;
S.class
% Bit is an eighth of a byte
bitSize = S.bytes * 8
Hope this helps
Walter Roberson
2022-8-16
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0]
bits_required_per_entry = max( ceil(log2(KEY)) )
However the calculation changes if any entry might be negative.
1 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!