2048 bit RSA is currently and for the foreseeable future secure.
512 bit is currently not considered useful.
1024 bit RSA though not currently known to be cracked doesn't have enough security margins for comfort. Definitely not for securing $1B USD. Several years ago the cost of a machine which could break 1024 bit RSA in a year was a few million. Cost presumably went down. And it is likely certain 3 letter organizations have such machines.
The best way to attack RSA is by factorizing the composite $n$ using Number Field Sieve. and though $1B is a lot of money I don't believe there is a known design which will break 2048 bit RSA for that budget.
However, there are other attacks to think of. Starting with how you share your public key. How does your friend know your public key is indeed yours.
Then there are various side channel attacks on RSA, if the attacker has timing or power or noise measurements of you computing stuff with the private key that can help.
Then of course to protect a $1B secret there better be plenty of physical security around your key.
Should large quantum computers become available RSA may be broken also for significant key sizes. Personally I don't expect this any time soon but plenty of smart people disagree.