from random import choice
from string import ascii_letters, digits #, punctuation
chars = ascii_letters + digits # + punctuation
length = 8 # 8 is really too short for the state of computers in 2021!
for number_of_passwords in range(4):
print("".join(choice(chars) for x in range(length)))
No, there are a lot of apps, that can set password not for itself, search photo password in AppStore. Idk how they do that.
For example : https://itunes.apple.com/ru/app/пароль-на-приложения/id492342639?mt=8
UPD: I only now see (on screens) that example and other apps not set password on photo, only delete photos from standard app and move it to own with password. I think the other do the same, sorry me.