Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Encrypt() - Password protected powerful Text Encryption


  • Please log in to reply
38 replies to this topic
A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Encrypt() v0.6
 
Encrypt() uses my custom algorithm SM_UniquePmt() to encrypt/ decrypt strings/
 
Calling - 

  • Encrypt(text, password)  - returns the encrypted text
  • Decrypt(text, password) -  returns the decrypted text

 

FEATURES - 

* SAME KEY (PASSWORD) FOR ENCRYPTION AND DECRYPTION

* ENCRYPTED STRING IS POWERFUL BUT OF SAME SIZE AS STRING
* PASSWORDS CAN BE CASE-SENSITIVE AND ALPHA-NUMERIC THUS SECURE AND EASY TO REMEMBER
* STRING'S CASE IS CONSERVED THROUGH THE PROCESS

 

Examples (MUST) - 

msgbox,% var1 := Encrypt("AutoHotkey_l", "lexikos") ;<-- ENCRYPT "AutoHotkey_l" with pwd "lexikos"
msgbox,% Decrypt(var1, "lexIkos") ;<--- Password problem. I is capital in lexikos
msgbox,% Decrypt(var1, "lexiko")   ;<--- s missing and you r dead
msgbox,% Decrypt(var1, "lexikos")  ;<--- Perfect password , perfect result

 
New in this version - 

*  PASSWORDS CAN BE NOW CASE-SENSITIVE AND ALPHA-NUMERIC THUS SECURE AND EASY TO REMEMBER
*  STRING'S CASE IS NOW CONSERVED THROUGH THE PROCESS
*  MORE CHARACTER SUPPORT(2x) , MORE POWERFUL

CHALLENGE
 <Removed> Should be a waste of time. Easy, small but good ones will be posted with next version.
 
 
 
DOWNLOAD Encrypt()
View Encrypt() History - Important for downloading older versions (Use the Browse code button)
 
Requires Scientific Maths Lib


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
The core of this cipher is very weak, it consists of a plain monoalphabetic substitution cipher, in which the cipher alphabet is generated using the key. It should be trivially easy to crack sufficiently longer texts using character frequency analysis.

A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

The core of this cipher is very weak, it consists of a plain monoalphabetic substitution cipher, in which the cipher alphabet is generated using the key. It should be trivially easy to crack sufficiently longer texts using character frequency analysis.

I actually have no idea about all those things. confused.png  I havent read the article there but I think the idea that there will be 48! permutations of password possible and the string arranged in a super different way with each permuation makes it difficult to crack. 

Can you try cracking the challenge ?wink.png


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007

I think the idea that there will be 48! permutations of password possible and the string arranged in a super different way with each permuation makes it difficult to crack.

Wrong. The key can be as random as you want, but the letter frequencies still are tell-tale. If 'E' (which is the most common letter in English texts) gets converted to '9', '9' will now be the most common character and one can guess that it stands for 'E'. Another useful tidbit is that if you are actually considering spaces in your cipher alphabet (which I see you do) it can also be easily detected since it is even more common than any other letter, and you can check for common word length patterns. Not to mention that if you make guesses about the plaintext and they happen to be correct you immediately get the meanings of many letters.

Can you try cracking the challenge ?

I am right now.

A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

If 'E' (which is the most common letter in English texts) gets converted to '9', '9' will now be the most common character and one can guess that it stands for 'E'.

Maybe right, but you can not always say . and then If I (or you) write the text in my/your native or folk language vocalised in English, it gets totally unpredictable.
 

 Another useful tidbit is that if you are actually considering spaces in your cipher alphabet (which I see you do) it can also be easily detected since it is even more common than any other letter, and you can check for common word length patterns.

Maybe. I think I should try to extract more information from the password and convert string alternately. Like first 10 chars of the string are converted using a different (replace) mask, the next 10 using a different and so on..
 


I am right now.

Best of luck. It's a simple text, I didnt thought techniques and tricks and glitches like you have mentioned exist


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
I cracked it: you are awesome, asshole !
Here's how:
  • I saw that 6 stands for space as you tend to preceed '!' with one of them.
  • I assumed it started with 'you'.
  • '9' was repeated twice, and according to this list I assumed it was 's' ("The most common double letters in order of frequency").
  • I used letter frequencies to see that rfs9 were the most common letters (and that somehow matched with etaoin shrldu)
  • After some thought and using a website, the pattern emerged.


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

I cracked it: you are awesome, asshole !

Good
 

I assumed it started with 'you'.

That could be called lucky.


.... After some thought and using a website, the pattern emerged.

Dangerous. I will try to extract more data from the password and create different replace masks for a string.


 Like first 10 chars of the string are converted using a different (replace) mask, the next 10 using a different and so on..

That would be the perfect idea. 
 
fincs, it would be pointless now to give a new challenge .I will come up with something more better tomorrow . Be ready !wink.png 


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
I would suggest to change the replace mask every character and make sure there is no period (i.e. the same mask is not used more than once in normal circumstances); otherwise it is possible to perform guesses on these 10-character chunks. Also, I would read up on cryptography in general before designing a cipher.

Just for the record, some years ago I came up with a cipher; and I posted a ciphertext online. It has not been cracked yet, partly because I did not reveal the algorithm (and that is necessary in order to tackle a cipher challenge) and embarrasingly enough I made some mistakes encrypting the text (by hand!).

A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

I would suggest to change the replace mask every character and make sure there is no period (i.e. the same mask is not used more than once in normal circumstances); otherwise it is possible to perform guesses on these 10-character chunks. Also, I would read up on cryptography in general before designing a cipher.

I will try to think on what the "password" can give to me and make a multi-staged password oriented algorithm accordingly.   

I personally am bery proud of my UniquePmt() work, I just thought that this should be possible and I did this. and now I am sure ,it can be used to make a perfect cipher.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

I would suggest to change the replace mask every character and make sure there is no period (i.e. the same mask is not used more than once in normal circumstances); otherwise it is possible to perform guesses on these 10-character chunks. Also, I would read up on cryptography in general before designing a cipher.

I have made the replacement frequency and replacement quantity all determined by the password in the latest 0.3 version and there's a new challenge too. This one would be difficult or impossible.
 

Just for the record, some years ago I came up with a cipher; and I posted a ciphertext online. It has not been cracked yet, partly because I did not reveal the algorithm (and that is necessary in order to tackle a cipher challenge) and embarrasingly enough I made some mistakes encrypting the text (by hand!).

I will not dare trying that. Without the algorithm, it gets very difficult


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
I think Lazlo posted such ciphers years ago, might be worthwhile for you to look at his posts.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

I think Lazlo posted such ciphers years ago, might be worthwhile for you to look at his posts.

Link Sir, I dont know what to search . I would like to see how he did it mathematically other than using Unique permutations from passwords.

By the way, welcome back. I can see you are very excited on coming back and are online for almost 4 hours now.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

I think Lazlo posted such ciphers years ago, might be worthwhile for you to look at his posts.

After searching around , I found http://www.autohotke...file-encryptor/ by Lazlo. But it seems to have a limit.

Characters with code less than 32 or larger than 126 are left unencrypted. 

What does it mean?

Were you talking about this script ?

 

EDIT:

It seems to work well. But the 5 encryption number-based Hex-type keys are impossible to remember.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


jNizM
  • Members
  • 928 posts
  • Last active: Jul 26 2017 09:19 AM
  • Joined: 01 Aug 2012
I think it's better to encrypt/decrypt with standards like AES 256

like Encrypt & Decrypt
with Crypt by Deo
Crypt.Encrypt.FileEncrypt(pFileIn,pFileOut,password,CryptAlg = 1, HashAlg = 1)
Crypt.Encrypt.FileDecrypt(pFileIn,pFileOut,password,CryptAlg = 1, HashAlg = 1)

Crypt.Encrypt.StrEncrypt(string,password,CryptAlg = 1, HashAlg = 1)
Crypt.Encrypt.StrDecrypt(EncryptedHash,password,CryptAlg = 1, HashAlg = 1)

[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703)
My GitHub Profile | Donations are appreciated if I could help you

A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

My main aim here is to make a custom algorithm that is uncrackable to a good extent. In similarity with AES, it has a symmetric key algorithm and nothing more.

By the way, the challenge for v0.3 is up there. I could have made v0.3 more stronger but that could have cause slowness, the current 0.3 uses password dependency to reasonably good effect.

Let's see who cracks the challenge.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan