arduino bluetooth password change with random numbers

I'd like to change bluetooth password with random numbers programming after using device.
Is it possible?

Which Bluetooth device do you have ?

i havent bought one yet any recommendation?

HC05 or HC06 are the usual recommendations.

The HC06 is easier to program because you don't need to get it into AT (command) mode to change parameters, but it has much more limited setup options and can only be used as a slave device whereas the HC05 can be used as a master or slave

Do some reading around before you decide