Code covered by the BSD License  

Highlights from
Encrypt email address

image thumbnail

Encrypt email address

by

 

08 Oct 2010 (Updated )

Create the vector which can be decipher with the command char(cumsum(vector)).

Encrypt_text(str)
function [vector_results] = Encrypt_text(str)
% Calculate the vector to display the email address as:
% char(cumsum(vector))
% input the string of the email address to be transformed
% for example: 
% char(cumsum(Encrypt_text('toto@tata.ti')))
% returns 'toto@tata.ti'

number_letter = length(str);

vector_num_letter = zeros(1,number_letter);
vector_results = zeros(1,number_letter);

q = 1:number_letter;
vector_num_letter(q) = double(str(q));  

vector_results(1) = vector_num_letter(1);
vector_results(2:end) = diff(vector_num_letter);

end

Contact us