A huge security flaw in Apple and Google devices leaves phone and computer users vulnerable to hacking when they go to supposedly secure websites, according to researchers.

Those using most major computing devices could be listened in on when they go to websites, allowing them to steal passwords and other information.

The flaw seems to have come from an old US government policy that didn’t allow companies to export products with “export-grade” encryption, according to researchers, which meant computers and software sold outside of the US had weak security.

Though that rule was lifted in the late 1990s, the weak security had already been built into many computers and so continued to allow hackers and other people to gain access to computers.

Hackers were able to exploit the way computers connect to secure sites. Internet browsers exchange “keys” with sites so that they can be identified. But those keys must be encrypted, or hackers can crack them and intercept communications.

More than one-third of secure websites were vulnerable to the attack according to tests. There is no way of knowing how much it has been exploited.

Companies running secure and sensitive websites have mostly corrected the problems, according to researchers, though the NSA’s website remains insecure.

Apple is preparing a fix for the problem for the Safari browser on its computers and phones. Though Google Chrome is not vulnerable, the browser that comes bundled with Android is — though Google has developed a patch to fix it, it will be up to manufacturers when to push that out to users’ phones.

Researchers have named the flaw “Freak”, which stands for Factoring Attack on RSA-Export keys.

Most experts thought that the technology behind it had fallen out of use. But the US restrictions, which were put in place as part of the “Crypto Wars” of the 1990s, meant that it continued to live on.

The problem arose because the systems continue to use 512-bit encryption — as opposed to the 1024-bit codes that are used now — which has for years been considered far too weak to use. One encryption expert said that the technology was “basically a zombie from the ‘90s”.