### Working with RSA encryption for the first time.

With keys you really should be thinking entropy, not length specifically. Anyways, yes you can expand a short key into a long key, a simple solution is just repeat the key until you fill it up, a more complex solution might be to hash it and repeat the hash to fill it up (that can make coding it easier). The issue is expanding a short key to a long key does not make the key more secure. For some algorithms it's acceptable, they require a key of some size, and you want a shorter key. In that case just repeat it, you'll get something that works.

As for security, it's generally very poor to just expand the key like that, since it makes the key easy to brute force. Take the password "hunter2" for example, it contains letters and numbers and it's 6 characters long. So this password contains log2((26+10)6) bits of entropy (about 31 bits of entropy). If you needed a 1024-bit password you could compress the password into 31 bits, and repeat those 31-bits ~33 times. You would have yourself a 1024-bit key. Unfortunately since you just repeated the key 33 times, an attacker can do the same in their attack. The result is that your key is less secure than a 31-bit key, no matter what algorithm you use to expand the key (how much less secure than a 31-bit key depends on the assumptions you make about the input password and sometimes the algorithms used to expand the key and how it interacts with your encryption). If you start requiring decent length passwords, you might have something difficult to crack, depends on the algorithm.