Encrypt Messages

dfragoso
Member Posts: 18
A way to encrypt messages, this code change the order of the message and change some letters for other symbols.
OnRun()
/////////////Encrypt Messages///////////
//Message
TextMessage := 'This message is encrypted';
Length := STRLEN(TextMessage);
//Message Encryption
i := Length;
REPEAT
Letter := COPYSTR (TextMessage,i ,1 );
ReverseMessage := ReverseMessage + Letter;
i := i - 1;
UNTIL i = 0;
EncryptedMessage := CONVERTSTR(ReverseMessage, 'AEIOUaeiou', 'º*!"#$.ç()');
MESSAGE(EncryptedMessage);
//Message Decryption
i := Length;
REPEAT
Letter := COPYSTR (EncryptedMessage,i ,1 );
ReverseMessage2 := ReverseMessage2 + Letter;
i := i - 1;
UNTIL i = 0;
EncryptedMessage := CONVERTSTR(ReverseMessage2, 'º*!"#$.ç()', 'AEIOUaeiou');
MESSAGE(EncryptedMessage);
OnRun()
/////////////Encrypt Messages///////////
//Message
TextMessage := 'This message is encrypted';
Length := STRLEN(TextMessage);
//Message Encryption
i := Length;
REPEAT
Letter := COPYSTR (TextMessage,i ,1 );
ReverseMessage := ReverseMessage + Letter;
i := i - 1;
UNTIL i = 0;
EncryptedMessage := CONVERTSTR(ReverseMessage, 'AEIOUaeiou', 'º*!"#$.ç()');
MESSAGE(EncryptedMessage);
//Message Decryption
i := Length;
REPEAT
Letter := COPYSTR (EncryptedMessage,i ,1 );
ReverseMessage2 := ReverseMessage2 + Letter;
i := i - 1;
UNTIL i = 0;
EncryptedMessage := CONVERTSTR(ReverseMessage2, 'º*!"#$.ç()', 'AEIOUaeiou');
MESSAGE(EncryptedMessage);
0
Comments
-
But do you have a question about it or do yo mean it as a tip&trick?Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
[Topic moved from Navision forum to Navision Tips & Tricks forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Well, when I needed some quick and trivial way to encrypt a text string I just XOR'ed it. Also, you don't need to use COPYSTR().
In my version, the main loop looks something like this://Message Encryption l := Length; for i := 1 to Length do TextMessage[i] := 255 - TextMessage[i];
And run the same loop one more time to decrypt the text.
Just to make it clear: in NO way this is an example of at least basic security measure.Vytenis Jakas
B3 Technologies - Making Technology Serve the People0 -
Hello, here is a post on how to encrypt/decrypt using SQL.
http://mibuso.com/blogs/ara3n/2009/05/2 ... -with-ado/0 -
vytjak wrote:
//Message Encryption l := Length; for i := 1 to Length do TextMessage[i] := 255 - TextMessage[i];
hi there...
i just came cross this post, so pardon me for the very late query on this topic. but please can you explain a bit more about this technique...
thanks in advancesmile always
shona
That which you seek inside is that which you find outside0 -
Shonatina wrote:vytjak wrote:
//Message Encryption l := Length; for i := 1 to Length do TextMessage[i] := 255 - TextMessage[i];
hi there...
i just came cross this post, so pardon me for the very late query on this topic. but please can you explain a bit more about this technique...
thanks in advance
Pretty simple.
Every character has it's number in ASCII table. Max value is 255. Min value is 0.
We go through all characters of the string and make another character by subtracting it's number from 255.
e.g. we have string 'ABC', in ASCIIcodes it will be numbers 65 66 67, after our cycle we'll have symbols wih numbers 190 189 188 => string '╛╜╝'.It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions