I need to add '0' to the end of plaintext, then I can use it within cipher to deduct it equally to 64-bit, the error in below code (append)

1 visualización (últimos 30 días)
plaintext = 'In literature, cryptosystems based on digital chaos were mostly designed for a broad range '
plainlen = length(plaintext);
y = mod(plainlen,8);
if y ~= 0
x = 8-y;
for j=1:x
plaintext=append(plaintext,'0'); %
end
end
  3 comentarios
Hussain
Hussain el 19 de Ag. de 2023
The problem was that the in (append) It's wroks normally when I use it in Matlab ver. 2021a, but it doesn't work and give error in Matlab ver. 2013b.
but I solved it,
Thanks and appreciate your response.
Walter Roberson
Walter Roberson el 19 de Ag. de 2023
append came into existence at the same time as string objects came into existence, which was a few years after R2013b.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 19 de Ag. de 2023
plaintext = 'In literature, cryptosystems based on digital chaos were mostly designed for a broad range '
plainlen = length(plaintext);
y = mod(plainlen,8);
if y ~= 0
plaintext = [plaintext, repmat('0', 1, 8-y)];
end

Categorías

Más información sobre Encryption / Cryptography en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by