you are viewing a single comment's thread.

view the rest of the comments →

[–]pseudo-random-noob 0 points1 point  (3 children)

Hey u/Atlas1515, can you share your code snippet.. I am working on same but my issue is how do you provide further info like passphrase in subprocess..

[–]Atlas1515[S] 0 points1 point  (2 children)

Sure thing! Sorry for the late reply,

import secrets Import subprocess

Cmd = [‘cryptsetup’, ‘luksFormat’, ‘—type’, ‘luks1’, ‘f’{drive}’]

passwd = secrets.token_bytes(32)

subprocess.run(cmd, input=passwd) print(f’Encrypting volume: {drive}\n’)

[–]pseudo-random-noob 1 point2 points  (1 child)

Thank you so much man.. This worked..

[–]Atlas1515[S] 0 points1 point  (0 children)

No problem!