encrypt

encrypt(textToEncrypt,password,op) encrypts char, string array and cell array of strings. password must be char of at least 6 characters.
op defines the strength of the encryption:
  • op = 'weak' (default)
  • op = 'strong': strong encryption has been disabled due to regulations, contact us at contact@mathlayer.com should you need this functionality.
This same function is used to decrypt a previous encrypted text.

Examples

>> str = 'test to encrypt'
str2 = encrypt(str,'password')

[str:test to encrypt]
[str2:Ï×ÀÌ“ÏÙ”ßÙ×ÄÁÆÂ]

>> fid = fopen('encrypt.example.txt','w+')
fprintf(fid, str2)
fclose(fid)

[fid:3]
[ans:1]

>> fid = fopen('encrypt.example.txt','r')
str3 = fgets(fid)
fclose(fid)

[fid:3]
[str3:Ï×ÀÌ“ÏÙ”ßÙ×ÄÁÆÂ]
[ans:1]

>> encrypt(str3,'abcdefg')#

Ë,<ÍoË&iÜÙ*;À9=

>> encrypt(str3,'password')#

test to encrypt

Resources

See also

fopen | fprintf