Encryption and Decryption Matlab CODE

Encryption and Decryption Matlab CODE

Matlab uses the standard computer character code (the so-called ASCII code),  Digital signal processing matlab code of the electronic information for image encryption and decryption .

 

function varargout = finaldsppro(varargin)
% FINALDSPPRO M-file for finaldsppro.fig
%      FINALDSPPRO, by itself, creates a new FINALDSPPRO or raises the existing
%      singleton*.
%
%      H = FINALDSPPRO returns the handle to a new FINALDSPPRO or the handle to
%      the existing singleton*.
%
%      FINALDSPPRO('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in FINALDSPPRO.M with the given input arguments.
%
%      FINALDSPPRO('Property','Value',...) creates a new FINALDSPPRO or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before finaldsppro_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to finaldsppro_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
 
% Edit the above text to modify the response to help finaldsppro
 
% Last Modified by GUIDE v2.5 04-Jun-2012 00:27:46
 
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @finaldsppro_OpeningFcn, ...
                   'gui_OutputFcn',  @finaldsppro_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end
 
if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
 
 
% --- Executes just before finaldsppro is made visible.
function finaldsppro_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to finaldsppro (see VARARGIN)
 
 
% Choose default command line output for finaldsppro
handles.output = hObject;
 
% Update handles structure
guidata(hObject, handles);
 
% UIWAIT makes finaldsppro wait for user response (see UIRESUME)
% uiwait(handles.figure1);
 
 
% --- Outputs from this function are returned to the command line.
function varargout = finaldsppro_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Get default command line output from handles structure
varargout{1} = handles.output;
 
 
 
function rand1_Callback(hObject, eventdata, handles)
% hObject    handle to rand1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: get(hObject,'String') returns contents of rand1 as text
%        str2double(get(hObject,'String')) returns contents of rand1 as a double
 
 
% --- Executes during object creation, after setting all properties.
function rand1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to rand1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
 
 
function rand2_Callback(hObject, eventdata, handles)
% hObject    handle to rand2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: get(hObject,'String') returns contents of rand2 as text
%        str2double(get(hObject,'String')) returns contents of rand2 as a double
 
 
% --- Executes during object creation, after setting all properties.
function rand2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to rand2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
 
 
function rand4_Callback(hObject, eventdata, handles)
% hObject    handle to rand4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: get(hObject,'String') returns contents of rand4 as text
%        str2double(get(hObject,'String')) returns contents of rand4 as a double
 
 
% --- Executes during object creation, after setting all properties.
function rand4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to rand4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
 
 
function rand3_Callback(hObject, eventdata, handles)
% hObject    handle to rand3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: get(hObject,'String') returns contents of rand3 as text
%        str2double(get(hObject,'String')) returns contents of rand3 as a double
 
 
% --- Executes during object creation, after setting all properties.
function rand3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to rand3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
 
 
function rand5_Callback(hObject, eventdata, handles)
% hObject    handle to rand5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: get(hObject,'String') returns contents of rand5 as text
%        str2double(get(hObject,'String')) returns contents of rand5 as a double
 
 
% --- Executes during object creation, after setting all properties.
function rand5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to rand5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
 
% --- Executes on selection change in freq.
function freq_Callback(hObject, eventdata, handles)
% hObject    handle to freq (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: contents = cellstr(get(hObject,'String')) returns freq contents as cell array
%        contents{get(hObject,'Value')} returns selected item from freq
 
 
% --- Executes during object creation, after setting all properties.
function freq_CreateFcn(hObject, eventdata, handles)
% hObject    handle to freq (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
 
% --- Executes on selection change in sign.
function sign_Callback(hObject, eventdata, handles)
% hObject    handle to sign (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: contents = cellstr(get(hObject,'String')) returns sign contents as cell array
%        contents{get(hObject,'Value')} returns selected item from sign
 
 
 
% --- Executes during object creation, after setting all properties.
function sign_CreateFcn(hObject, eventdata, handles)
% hObject    handle to sign (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
 
% --- Executes on button press in encrypt.
function encrypt_Callback(hObject, eventdata, handles)
% hObject    handle to encrypt (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
f = str2double(get(handles.freq,'String'))
z = get(handles.sign,'String')
T=1/f
t=0:0.0005:T
 
 
switch lower (z)
   case 'sine'
      y=sin(2*pi*f*t)
   case 'square'
      y=square(2*pi*f*t)
   case 'sawtooth'
       y=sawtooth(2*pi*f*t)
end
a = str2double(get(handles.rand1,'String'))
b = str2double(get(handles.rand2,'String'))
c = str2double(get(handles.rand3,'String'))
d = str2double(get(handles.rand4,'String'))
e = str2double(get(handles.rand5,'String'))
x=[a b c d e;a-2 b*7 c-1 d+4 e/4;a-3 b/8 c-3 d e+2*5;a*4 b/4 c*4 d-1 e-3;a-3 b+4 c*4 d-4 e-9]
noise=[x/2*(10^-1)+x^2/6*(10^-2)+x^4/9*(10^-3)+x^4/12*(10^-4)+x^4/16*(10^-5)+x^4/20*(10^-6)+x^8/24*(10^-7)]*10^-3
h=0:length(noise)
b=reshape(noise,25,1)
p=b'
o=[p zeros(1,length(t)-25)]
 
mod=o.*y
n=0:length(mod)-1
stem(handles.axes4,n,mod)
set(handles.axes4)
 
 
 
% --- Executes on button press in decrypt.
function decrypt_Callback(hObject, eventdata, handles)
% hObject    handle to decrypt (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
f = str2double(get(handles.freq,'String'))
z = get(handles.sign,'String')
T=1/f
t=0:0.0005:T
 
 
switch lower (z)
   case 'sine'
      y=sin(2*pi*f*t)
   case 'square'
      y=square(2*pi*f*t)
   case 'sawtooth'
       y=sawtooth(2*pi*f*t)
end
a = str2double(get(handles.rand1,'String'))
b = str2double(get(handles.rand2,'String'))
c = str2double(get(handles.rand3,'String'))
d = str2double(get(handles.rand4,'String'))
e = str2double(get(handles.rand5,'String'))
x=[a b c d e;a-2 b*7 c-1 d+4 e/4;a-3 b/8 c-3 d e+2*5;a*4 b/4 c*4 d-1 e-3;a-3 b+4 c*4 d-4 e-9]
noise=[x/2*(10^-1)+x^2/6*(10^-2)+x^4/9*(10^-3)+x^4/12*(10^-4)+x^4/16*(10^-5)+x^4/20*(10^-6)+x^8/24*(10^-7)]*10^-3
h=0:length(noise)
b=reshape(noise,25,1)
p=b'
o=[p zeros(1,length(t)-25)]
 
mod=o.*y
dmod=mod./o
n=0:length(dmod)-1
stem(handles.axes5,n,dmod)
set(handles.axes5)
 
 
% --- Executes on button press in random.
function random_Callback(hObject, eventdata, handles)
% hObject    handle to random (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
a = str2double(get(handles.rand1,'String'))
b = str2double(get(handles.rand2,'String'))
c = str2double(get(handles.rand3,'String'))
d = str2double(get(handles.rand4,'String'))
e = str2double(get(handles.rand5,'String'))
x=[a b c d e;a-2 b*7 c-1 d+4 e/4;a-3 b/8 c-3 d e+2*5;a*4 b/4 c*4 d-1 e-3;a-3 b+4 c*4 d-4 e-9]
noise=[x/2*(10^-1)+x^2/6*(10^-2)+x^4/9*(10^-3)+x^4/12*(10^-4)+x^4/16*(10^-5)+x^4/20*(10^-6)+x^8/24*(10^-7)]*10^-3
n=0:length(noise)-1
stem(handles.axes3,n,noise)
 
 
% --- Executes on button press in signal.
function signal_Callback(hObject, eventdata, handles)
% hObject    handle to signal (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
f = str2double(get(handles.freq,'String'))
z = get(handles.sign,'String')
T=1/f
t=0:0.0005:T
switch lower (z)
   case 'sine'
      y=sin(2*pi*f*t)
   case 'square'
      y=square(2*pi*f*t)
   case 'sawtooth'
       y=sawtooth(2*pi*f*t)
end
 plot(handles.axes1,t,y)
set(handles.axes1)
n=0:length(y)-1
stem(handles.axes2,n,y)
set(handles.axes2)
grid on
guidata(hObject,handles)
  
.
.

6 Comments

  1. vps April 18, 2013
  2. Lý Ngọc Liên November 13, 2012
    • sussi laita January 25, 2013
  3. Ali Aswant July 1, 2012
  4. Moaz_peopledontcare July 1, 2012

winrar crack
minecraft free download
http://xn--forbrukslnportalen-dub.net
Forsikring Bolig Pris
Profesjonell Radonmåling Svelvik
Pris På Boligalarm I Torsken
Forbrukslån Best I Test Centum Finans
Rimelig Overnatting Porsgrunn Sentrum