Encrypting and Decrypting Challenge

-1

Encrypting Challenge

Your encrypting program must be able to do following things:

  1. Input password
  2. Generate random key
  3. Encrypt random key with set key

    Then, the decrypting program must be able to these things:

  4. Input encrypted password
  5. Input encrypted random key
  6. Decrypt random key
  7. Decrypt password with decrypted random key
  8. Print password

The encryption must be setted with the key. It must be a table encryption or a encryption which makes the unencrypted values to a part of the key. This is . The shortest program wins!

Mega Man

Posted 2016-05-02T12:20:37.493

Reputation: 1 379

Question was closed 2016-05-02T12:31:49.823

3I voted to close as unclear what you're asking, because I'm not even sure what the inputs are for all of the mentioned use cases. However, you also need to narrow down the spec to avoid the question being closed as too broad. What counts as "encrypted". – Peter Taylor – 2016-05-02T12:28:50.273

1encrypt=(p,k)=>p+k; decrypt=(p,k)=>p.substring(0,p.indexOf(k)); Best encryption method ever! Very secure! Jokes aside, you should probably specify what kind of encryption method should be used, or restrict to a set of methods. As it is, this challenge is too broad to produce fair results – Bassdrop Cumberwubwubwub – 2016-05-02T12:35:15.280

I see you've tried to clarify the challenge a bit with your recent edit, but I'm still not sure what counts as "encryption" here. There's a lot of ways to encrypt something, some good, many bad (e.g. Bas' example), so unfortunately the question is still quite broad as is... – Sp3000 – 2016-05-03T13:06:22.727

It doesn't matter which kind of encryption you choose, it may be Casear, BASE64... Just take any encryption. – Mega Man – 2016-05-03T13:46:57.087

...so, double ROT-13 is fair game? – Sanchises – 2016-05-03T16:40:40.127

Function(s) or complete program? If a complete program, what should be the command-line? If any cypher is allowed, I choose the null cypher: the plaintext is passed as-is to the cyphertext, ignoring the password. Please set the encryption method. – jose_castro_arnaud – 2016-05-04T01:09:21.303

@MegaMan Base64 is not an encryption method. – Poke – 2016-06-24T18:31:08.603

Didn't know it, but when I think about it... – Mega Man – 2016-06-25T05:13:06.363

Answers

0

Pyth, 16+16 = 32 bytes

Encryption:

s@LG+VxLGQxLG*zl

Try it online!

Decryption:

s@LG-VxLGQxLG*zl

Try it online!

Uses Vigenère cipher.

Table of Vigenère cipher

Leaky Nun

Posted 2016-05-02T12:20:37.493

Reputation: 45 011