I HAVE A KEY WHICH IS 1*16 MATRIX. HOW CAN I DETERMINE IT'S BIT SIZE?

1 vue (au cours des 30 derniers jours)
sabitri
sabitri le 16 Août 2022
Commenté : sabitri le 16 Août 2022
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0]

Réponse acceptée

KSSV
KSSV le 16 Août 2022
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0] ;
a = single(KEY) ;
iwant = whos('a')
iwant = struct with fields:
name: 'a' size: [1 16] bytes: 64 class: 'single' global: 0 sparse: 0 complex: 0 nesting: [1×1 struct] persistent: 0
  3 commentaires
sabitri
sabitri le 16 Août 2022
Okay...It’s clear to me now..Thanks

Connectez-vous pour commenter.

Plus de réponses (2)

Abderrahim. B
Abderrahim. B le 16 Août 2022
Modifié(e) : Abderrahim. B le 16 Août 2022
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
ans = 'single'
% Bit is an eighth of a byte
bitSize = S.bytes * 8
bitSize = 512
Hope this helps
  1 commentaire
sabitri
sabitri le 16 Août 2022
Thanks a lot. Will this key prevent brute force attack?

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 16 Août 2022
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0]
KEY = 1×16
0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0
bits_required_per_entry = max( ceil(log2(KEY)) )
bits_required_per_entry = 4
However the calculation changes if any entry might be negative.
  1 commentaire
Walter Roberson
Walter Roberson le 16 Août 2022
Also, the calculation changes if any entry might have fractions.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Encryption / Cryptography dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by