More holiday shoppers than ever will go online this year to search for the perfect Christmas gift. According to the National Retail Federation, about 57 percent of consumers will turn to their computers and smartphones to shop, just a tad more than the number of consumers who will shop at walk-in stores. 

But as more people take to online shopping to buy holiday gifts, shoppers have to take more precautions: Cybercrime is rising. "More transactions certainly open up consumers to more opportunity for fraud," says Raymond Pucci, associate director of research services at the Mercator Advisory Group consulting firm.

When shopping online, be sure to take steps to safeguard your credit cards and bank accounts. Here are four ways to protect yourself:

Go to Consumer Reports' 2016 Holiday Gift Guide for updates on deals, expert product reviews, insider tips on shopping, and much more. Be sure to check our Daily Gift Guide, and sign up to get an e-newsletter with top picks, trusted product reviews, and the latest news from CR.

Pay with a mobile wallet. If you're using a mobile device to shop, pay for your purchases with a mobile wallet such as Android Pay or Apple Pay. In general, mobile wallets are more secure than physical payment cards because they encrypt the transaction data and use tokens, or substitute numbers, in place of the real debit or credit card numbers stored in the wallet app.

The smartphone itself also adds another layer of security, by authenticating your identity with its fingerprint reader, by tracking the device's location relative to your usual travel patterns, and even by assessing the normal manner and speed of your keystrokes, Pucci says. 

Take advantage of credit card security features. There are all kinds of security features you can register for as well. Bank of America, for example, offers a program called Bank of America ShopSafe, and Citibank offers something similar known as Citi Virtual Account Numbers.

Here's how they work: Before you go shopping online, you can log on to your credit card account and get a temporary credit card number. The credit card company knows that number is linked to your card, so when you give it to a merchant online, your transaction will go through. But your card is safer because the merchant never sees the real account number, and if hackers steal the online retailer's data, they'll only get the temporary number, which at that point will be useless to them. 

Another great security feature: Turn your card off when you're not using it. Capital One and Discover credit cards, for example, allow you to disable your cards when you're not using them by using an app on your smartphone.

You can also beef up your credit card's security by registering it with American Express SafeKey, MasterCard SecureCode, or Verified by Visa. After you've done that, you can create a personal identification number that only you know. When you're shopping online, you'll be asked to punch the code in before the credit card will authorize the transaction. 

Avoid paying with a bank debit card. If you pay for online purchases with a debit card and there is a data breach, a crook could access your card's underlying checking account. Although your bank deposits are protected against unauthorized withdrawals, there might be a period where you don't have access to those funds while the theft is being investigated, Pucci says.

A better option: Pay with a credit card, which provides better consumer protections and allows you to reverse a charge if the goods are not delivered as promised. Or, if you don't want to risk running up a credit balance, consider a prepaid card, which doesn't offer credit, is not connected to your bank account, and provides zero loss liability protection for unauthorized charges (if you register the card). 

Stick to legitimate shopping websites. Shop only at websites with a web address (URL) that begins with "shttp" or "https." The "s" indicates that the site is encrypted, according to the National Cyber Security Alliance, a nonprofit security education group.

Pucci also advises online shoppers to let secured sites keep your credit card account number on file, which actually can improve the security of the card. By giving them your card number, online retailers can use software algorithms to compare each transaction made to your normal spending habits. That makes it easier for them to detect a transaction that may be fraudulent.