[DEL] Delete pygost
This commit is contained in:
@@ -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():
|
||||
|
||||
|
||||
Reference in New Issue
Block a user