Making rice and beans shelf stable

Hello, I am completely uneducated on making food shelf stable. I am wanting to start building an emergency food stash of some sort. I know rice and beans are already shelf stable but what would be the most affordable and easiest way to seal/can these to make them last for many years?