Social Security is paid for by every person that works, in the US. Each person, more or less, pays his own future Social Security, out of each paycheck.
This system worked fine, right up until the US govt. started loaning themselves some money from the SS fund. Then didn't pay it back.
Medicare Part A comes with Social Security, Part B, C, D etc., are payed for by the SS recipient.
Yes, the amount of folks on SS grows exponentially, but so does the amount of folks paying INTO SS all their working lives. All that has to happen to get SS back on track, is for the govt. to pay back what they took from SS. Well, and people that didn't work all their lives in the US and pay into SS, shouldn't get it.
If these two things are done, SS works fine.