If your goal is to keep bears from eating human food for their safety then a bear canister may be your best option.
If your goal is to keep bears and other critters from eating what you brought to eat yourself then there are multiple options.
On another note ;I have to ask folks who sleep with their food, "aren't you concerned about other critters?"
Mice can carry as many as 100 ticks. I would be afraid to have food in my tent for fear of mice /ticks /Lyme disease.