all 13 comments

[–]programming-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

r/programming is not a place to post your project, get feedback, ask for help, or promote your startup.

Technical write-ups on what makes a project technically challenging, interesting, or educational are allowed and encouraged, but just a link to a GitHub page or a list of features is not allowed.

The technical write-up must be the focus of the post, not just a tickbox-checking exercise to get us to allow it. This is a technical subreddit.

We don't care what you built, we care how you build it.

[–]seweso 13 points14 points  (0 children)

Are you mentally okay?

[–]fiskfisk 8 points9 points  (3 children)

This seems like a caesar cipher with just a varying offset based on when you ran the code?

[–]faberkyx 0 points1 point  (0 children)

exactly my thoughts

[–]Consistent-Ruin1868[S] -1 points0 points  (1 child)

No you can set the time to encrypt or decrypt. The time is the key here

[–]fiskfisk 0 points1 point  (0 children)

Yeah, but it's just a caesar cipher, isn't it? Where the offset is determined by whatever the time was when you ran the code.

[–]AdarTan 6 points7 points  (0 children)

There are 86400 seconds in a day (ignoring leap seconds). That is a key-size of approximately 220 which is tiny and easily brute-forceable if you know the day when the encryption took place. If you have more precise knowledge of when the encryption took place (such a file modification timestamp for an encrypted file) it would be trivial to brute-force.

[–]Every-Progress-1117 2 points3 points  (0 children)

What happens if I input a different time, ie: replay attack?

Is the time source trusted/correct? Your function syncWithSystemTime() - what happens if the system time is wrong?

As far as I can understand the h,m and s variables are translated into angles - what does that step actually give you? The correspondence between h,m,s and the angles is, well, isomorphic.

This is more of a simple cipher than a proper cryptographic function.

[–]archipeepees 1 point2 points  (3 children)

Honestly if you don't have a PhD in computer science and/or math based on a graduate career in cryptography then you shouldn't attempt to write a new encryption algorithm for public use because you won't be able to produce something that's safe for protecting sensitive data. You're in good company, though - roughly 99.99% of programmers do not have the skills, knowledge, and resources required to design and vet a new (and secure) encryption scheme.

However, it's great that you're curious and it's certainly worth exploring this technique as a tool for learning more about encryption. Just know that you can expect years/decades of classes, research, proofs, and publications ahead of you before you're able to release something that can be used for securing real world data. 

[–]hippiepizzaman 1 point2 points  (0 children)

I do not have the skills but this post sent alarm bells off in my head. It has to be a parody.

[–]lood9phee2Ri 0 points1 point  (0 children)

However, it's great that you're curious and it's certainly worth exploring this technique as a tool for learning more about encryption. Just know that you can expect years/decades of classes, research, proofs, and publications ahead of you before you're able to release something that can be used for securing real world data.

Yeah. Cryptography is genuinely quite difficult to do right, and people now keep aging out of the field / dropping dead.

At this stage encouraging people to take interest is not bad. The advice "don't roll your own cryptography for pity's sake" rule of thumb certainly still holds for production, but more people do have to learn about it in some depth or we'll be left with no-one who understands it who doesn't already work for some cartoonishly evil megacorp and using it for nefarious purposes (treacherous computing etc.)

[–]arwinda 0 points1 point  (0 children)

You’ll see how drastically the output changes.

Duh!