[DEL] Delete pygost

This commit is contained in:
2024-04-14 16:15:41 +03:00
parent 8c7a8c9675
commit f56f450fdf
130 changed files with 7 additions and 20548 deletions

View File

@@ -1,9 +1,8 @@
import threading
import os
import pygost.gost3412 as gost
# from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
# from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
erasing_methods = {
"2 прохода": {
@@ -32,17 +31,12 @@ erasing_methods = {
def get_random_bytes(size):
seed=os.urandom(32)
# backend = default_backend()
# cipher = Cipher(algorithms.AES(seed), modes.CTR(b'\0'*16), backend=backend)
# encryptor = cipher.encryptor()
backend = default_backend()
cipher = Cipher(algorithms.AES(seed), modes.CTR(b'\0'*16), backend=backend)
encryptor = cipher.encryptor()
nulls=b'\0'*(size)
enc = gost.GOST3412Kuznechik(seed)
rounds = int(size / 32)
data = b''
for i in range(512):
data += enc.encrypt(nulls)
return data
return encryptor.update(nulls)
class Drive():