-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a090c4a
commit 7525f93
Showing
2 changed files
with
91 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,35 @@ | ||
import ChrEnD | ||
from math import sqrt | ||
import chrend | ||
|
||
encrypted = ChrEnD.encrypt('hello') | ||
decrypted = ChrEnD.decrypt(encrypted) | ||
|
||
print(encrypted) | ||
print(decrypted) | ||
seed = chrend.seed(turns=1, modifiers=[("+", "%l"), ("*", 2)]) | ||
print(seed) | ||
|
||
|
||
encrypted = chrend.encrypt('hello ma boi :)', seed=seed) | ||
print(repr(encrypted)) | ||
|
||
tencrypted = chrend.transform(encrypted) | ||
print(repr(tencrypted)) | ||
|
||
encrypted = chrend.untransform(tencrypted) | ||
print(repr(encrypted)) | ||
|
||
decrypted = chrend.decrypt(encrypted, seed=seed) | ||
print(repr(decrypted)) | ||
|
||
|
||
""" | ||
If my math doesn't sucks: | ||
should be better than SHA-256: | ||
2 ** 256 VS 10027035 ** 12 | ||
should be better than SHA-512: | ||
2 ** 256 VS 10027035 ** 23 | ||
""" | ||
print('Beat SHA-256:', chrend.combinations(1, 12, 0x110000) > 2 ** 256) | ||
print('Beat SHA-512:', chrend.combinations(1, 23, 0x110000) > 2 ** 512) |