طلب مساعدة رجاء

برجاء استخدام تنسيق الكود بواسطة هذا الزر

X غير معرفة

لو سمحت تشوف لي الحل لان محاجته بكرة

ممكن تكتبلي الكود الصحيح
هو البرنامج تشفير الكلام الي على الصورة

انا قولتلك X غير معرفة وازاى هتقدرى تستخرجى الكلام اللى على الصورة وهتشفرية ازاى
ياريت توضحيلى اكتر علشان اقدر اساعدك

key(1,m) = X(m,3);

اين X هل هى الصورة التى قمتى بعمل imread ام شيىء أخر
ثانيا لماذا 3 الموجودة فى الكود ؟؟ هل تريدين الدخول الى الثلاثة قنوات الموجودة فى الصورة ؟؟

هي صورة وعليها كلام بعد التشفير يختفي الكلام وتبقى الصورة

وفين برنامج التشفير اللى بيحط الكلام على الصورة ؟

البرنامج اللى ارسلتيه غير مفهوم ولا اقدر اساعدك الا اذا عملتى بعض التوضيحات

هذا البرنامج شكل ماراح يشتغل عندك برنامج ثاني يشتغل

البرنامج الذى ارسلتيه يحتوى على اخطاء ومنطقيا غير مفهوم ولا احد يستطيع معرفة ما تحاولين القيام به فى هذا البرنامج لانه مبهم وطبعا هذه ليست طريقة برمجية صحيحة

function ct = aescrypt(pt,key)
[FONT=Courier New][SIZE=2][COLOR=#228b22]% AESCRYPT - encrypt a message using 128-bit AES
%
% USAGE: ct = aescrypt(pt,key)
%
% pt = plaintext, a vector in char or uint8 form
% key = encryption key, which must be a character string or uint8 vector
% ct = cyphertext
%
% Notes: (1) This function requires Java, which contains the encryption
% routines.
% (2) The provided key may have any (nonzero) length. It is hashed
% to 128 bits using the MD5 hash algorithm.
% (3) Use this function with the separate DZIP routine to enable
% encryption of several Matlab data types, e.g.
% ct=aescrypt(dzip(M),key)
% (4) Carefully tested but no warranty, use at your own risk.
% (5) Michael Kleder, Nov 2005
%
% EXAMPLE:
%
% M=rand(100);
% key=‘This is my test encryption key, for trial use.’;
% ct=aescrypt(dzip(M),key);
% N=dunzip(aesdecrypt(ct,key));
% all(M(:)==N(:))

[/color][/size][/font]if length(pt) ~= length(pt(:))
error(
‘Plaintext must have only one non-singleton dimension.’)
end
pt=pt(:)’;
c = class(pt);
if ~strcmp(c,‘uint8’) & ~strcmp(c,‘char’)
error(
‘Plaintext must be in char or uint8 form.’)
end
pt=uint8(pt);
c = class(key);
if ~strcmp(c,‘uint8’) & ~strcmp(c,‘char’)
error(
‘Key be in char or uint8 form.’)
end
x=java.security.MessageDigest.getInstance(‘MD5’);
x.update(uint8(key(:)));
key=typecast(x.digest,
‘uint8’);
s=javax.crypto.spec.SecretKeySpec(key,
‘AES’);
c=javax.crypto.Cipher.getInstance(
‘AES’);
c.init(1,s)
ct = typecast(c.doFinal(pt),
‘uint8’)’;
return



 
function ct = aescrypt(pt,key)
% AESCRYPT - encrypt a message using 128-bit AES
%
% USAGE: ct = aescrypt(pt,key)
%
% pt = plaintext, a vector in char or uint8 form
% key = encryption key, which must be a character string or uint8 vector
% ct = cyphertext
%
% Notes: (1) This function requires Java, which contains the encryption
% routines.
% (2) The provided key may have any (nonzero) length. It is hashed
% to 128 bits using the MD5 hash algorithm.
% (3) Use this function with the separate DZIP routine to enable
% encryption of several Matlab data types, e.g.
% ct=aescrypt(dzip(M),key)
% (4) Carefully tested but no warranty, use at your own risk.
% (5) Michael Kleder, Nov 2005
%
% EXAMPLE:
%
% M=rand(100);
% key='This is my test encryption key, for trial use.';
% ct=aescrypt(dzip(M),key);
% N=dunzip(aesdecrypt(ct,key));
% all(M(:)==N(:))

if length(pt) ~= length(pt(:))
error('Plaintext must have only one non-singleton dimension.')
end
pt=pt(:)';
c = class(pt);
if ~strcmp(c,'uint8') & ~strcmp(c,'char')
error('Plaintext must be in char or uint8 form.')
end
pt=uint8(pt);
c = class(key);
if ~strcmp(c,'uint8') & ~strcmp(c,'char')
error('Key be in char or uint8 form.')
end
x=java.security.MessageDigest.getInstance('MD5');
x.update(uint8(key(:)));
key=typecast(x.digest,'uint8');
s=javax.crypto.spec.SecretKeySpec(key,'AES');
c=javax.crypto.Cipher.getInstance('AES');
c.init(1,s)
ct = typecast(c.doFinal(pt),'uint8')';
return

هذا الكود كمان طلع فيه اخطاء

ما هو مصدر هذا الكود ؟؟

الرابط الي اعطيتني هو

ان شاء الله هشوفها بكرة وهرد عليكى

هذا الملف المرفق به 2 m file قومى بوضعهم فى current directory حتى يستطيع الماتلاب رؤيتهم

والان يتطلب عليك الحصول على Dzip & dunzip لتشفير انواع اخرى من بيانات الماتلاب
وموجودين فى المرفق الثانى
والاستخدام كالاتى


USAGE: ct = aescrypt(pt,key) 
       pt = aesdecrypt(ct,key)
  pt  = plaintext, a vector in char or uint8 form 
key = encryption key, which must be a string or uint8 vector 
ct  = cyphertext, in uint8 form


والان قومى بتطبيق المثال الاتى


M=rand(1000);
key=uint8(rand(1,16)*255);
ct=aescrypt(dzip(M),key);
N=dunzip(aesdecrypt(ct,key));
all(M(:)==N(:))

طيب هذا الكود الي مكتوب فين اكتب

مش فاهم