I use 7-zip which supports .rar file types , and of course .zip . There’s a checkbox option when compressing to “Password protect” the created Archive. I dont know what program your using , but I’m pretty sure most do so.